<aeth>
Josh_2: that's interesting, if it's at the end of a definition does it implicitly add a t? Yours was in the middle.
<Josh_2>
oof its cos I had a keyword after
<Josh_2>
aeth: exactly that
<aeth>
still weird to have an implicit t like that
<Josh_2>
webdev is certainly more enjoyable when not using PHP
<buffergn0me>
verisimilitude: I had a good experience using CL's rationals for currency calculations, and storing the results as decimal fixed point in a SQL database
<Josh_2>
CL making more things more fun :D
LiamH has quit [Quit: Leaving.]
python476 has quit [Ping timeout: 252 seconds]
Aruseus has quit [Remote host closed the connection]
quazimodo has joined #lisp
quazimod1 has joined #lisp
quazimod2 has joined #lisp
<aeth>
buffergn0me: I suspect the issue is that CL's rationals are afaik bignum/bignum, but with decimal fixed point you could have (bignum-or-fixnum)/fixnum where the bignum-or-fixnum could be restricted just like (integer 5 42) can. Even fixnum/fixnum would still cons, but that does open up the way for consing-removal, like you can do with double-float and ub64/sb64 in some niche cases.
quazimodo has quit [Client Quit]
quazimod1 has quit [Client Quit]
quazimod2 has quit [Client Quit]
<aeth>
buffergn0me: If you were running CL on your bank's mainframe, fixnum/fixnum with the box-removing optimizations like double-float/ub64/sb64 can get could be a huge performance win.
dreamcompiler has joined #lisp
<aeth>
You could probably even get a decent representation to fit in 64 bits.
CCDelivery has joined #lisp
<buffergn0me>
Oh definitely, decimal arithmetic is going to be way faster than rationals
quazimodo has joined #lisp
<aeth>
You wouldn't have to deal with the rounding manually, either. The two real problems with rationals is that your numerator and denominator tend to keep growing, and if you implemented rational versions of stuff like sqrt, sin, cos, tan, etc. it's unclear where to round.
karlosz has quit [Quit: karlosz]
<aeth>
On the numerator/denominator growing part... I mostly use rationals as an intermediate and then coerce to double at the end so I can actually read the result.
<buffergn0me>
Yes, rationals are definitely a problem for transcendental functions
<aeth>
Oh, i said fixed point for currency-style computations would never happen because it would be too niche/controversial, but it actually could happen, not because of banks but because of cryptocurrencies.
<buffergn0me>
I don't think decimal fixed point is too niche at all
<buffergn0me>
Ideally there should also be some kind of optional support for decimal floating point too
<buffergn0me>
POWER processors have had hardware for that since POWER6
<aeth>
Well, the main modern use for fixed point is probably determinism over the network, which you see for cryptocurrencies and cryptocurrency-style decentralized projects.
<buffergn0me>
I see a lot of floating point use in currency calculations, and it always results in rounding bugs that become apparent sooner or later
<aeth>
buffergn0me: Yes, but how much of that is floating point in general and how much of that is not using decimal floating point?
nowhereman has joined #lisp
<buffergn0me>
aeth: IDK, I don't know enough about numeric analysis. Just that fixed-point decimal support would make it easy to avoid that problem. Mostly just by virtue of being an obvious thing that you could point people to
<aeth>
For robustness, you'd probably want decimal floating point and decimal fixed point as well as binary fixed point (cryptocurrencies and other similar things are probably going to use more of the latter).
<aeth>
I'm not sure how they'd fit in the numeric tower, though.
<aeth>
I guess you'd have to explicitly literal or coerce them
robdog has joined #lisp
<aeth>
If you were proposing this in the standard, though, it would have to be some kind of optional support. So coersion would be weird. The optional stuff (e.g. long-float) don't really error in the current standard, they just try to do something reasonable. e.g. (coerce 42 'long-float) might return 42d0 or even 42f0 and (upgraded-array-element-type 'array) or any other valid but unlikely type is almost certainly T.
karlosz has joined #lisp
<buffergn0me>
The big problem with binary is that it fails on things divisible by 10, so even simple sums of currencies divisible by hundreds will be off sometimes
<buffergn0me>
My concern would be about what happens if you (+ decimal-floating-point binary-floating-point) or similar
<aeth>
So the only complicating factor is mixing the decimal and binary representations, i.e. decimal+binary floats or decimal+binary fixed
<buffergn0me>
(+ fixed-point rational) should go to rational
robdog has quit [Ping timeout: 252 seconds]
<aeth>
buffergn0me: (+ fixed-point rational) => rational might be confusing because rational doesn't have a result for stuff like sin so e.g. (sin 42/5) without any coersion in there is a single-float, meaning (sin (+ fixed-point rational)) => single-float when you might be expecting fixed-point, assuming a fixed-point sin
Lord_of_Life has joined #lisp
<aeth>
also e.g. (+ 414879609/234789784 43.4f0) => single-float
<buffergn0me>
aeth: Haha, and you had just mentioned that a few minutes ago. Numeric issues are hard
<aeth>
What probably makes the most sense is everything going to fixed point if mixed with fixed point, except for float types, which supercede fixed point.
<aeth>
Mixing decimal and binary of the same representation type would be the only truly complicating factor imo.
<aeth>
You could make the argument both ways, that if someone's using decimal they probably want decimal and that binary is in some sense more basic.
<aeth>
It's more difficult because this is a mostly dynamically typed language, although you'd probably want declarations or the or check-type in this sort of code to be safe, anyway.
jruchti has quit [Ping timeout: 268 seconds]
<aeth>
(I say "mostly" because if I speak in absolutes on IRC, someone will come up with some strange edge case.)
dddddd has quit [Remote host closed the connection]
robdog has joined #lisp
nalkri has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
jack_rabbit has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
<buffergn0me>
Josh_2: The best way to handle macro redefinitions is to reload the whole ASDF system. Same thing if any functions are inlined
robdog has quit [Ping timeout: 252 seconds]
CCDelivery has quit [Remote host closed the connection]
ggole has joined #lisp
torbo has quit [Remote host closed the connection]
robdog has joined #lisp
<fiddlerwoaroof>
Although, in many cases C-c C-k is sufficient
marvin2 has quit [Ping timeout: 255 seconds]
<Josh_2>
alrighty
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
robdog_ has quit [Ping timeout: 252 seconds]
vlatkoB has joined #lisp
hlavaty has quit [Ping timeout: 240 seconds]
robdog has joined #lisp
Bike has quit [Quit: Lost terminal]
<no-defun-allowed>
How do I update ASDF on CCL?
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
<no-defun-allowed>
Hmm...it seems my laptop (on SBCL) has ASDF 3.3 but my Pi (on CCL) has ASDF 2.
<no-defun-allowed>
Got it, I just have to download it and load it.
<loke>
no-defun-allowed: Are you running a very old release of ccl?
<loke>
on ARM, the latest CCL should be the same as the x86 version.
<no-defun-allowed>
I downloaded the "latest" one from ccl.clozure.com.
<no-defun-allowed>
1.11.5
<LdBeth>
#'no-defun-allowed: you don't need to update the one shipped with CCL, just load the newest ASDF
<no-defun-allowed>
Yeah, that worked fine.
<LdBeth>
Since ASDF is not loaded until been required, there's no conflict issue
<no-defun-allowed>
Error: Foreign function not found: ARM-LINUX::|gethostname|
<no-defun-allowed>
Oh dear. Gnuxie 💜🐝 had this problem on CCL, and now it's spread to my Pi.
robdog has quit [Ping timeout: 252 seconds]
<no-defun-allowed>
Maybe I'll try again with 1.12.
<no-defun-allowed>
It works correctly on 1.12!
wanz has joined #lisp
<aeth>
Josh_2: I guess uninterning works (and similarly, things like unexporting) but I usually just restart slime when there are weird edge cases. It sometimes catches bugs to restart an image, anyway, like when I rename a function but don't update all callers so something is calling a stale function (which will be undefined when SLIME restarts).
<aeth>
Actually, I usually restart SLIME before pushing commits to the host because it has caused tests to fail before.
rippa has joined #lisp
<Josh_2>
hmm alright
dale has quit [Quit: dale]
robdog has joined #lisp
dmiles has quit [Ping timeout: 240 seconds]
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
makomo has quit [Ping timeout: 250 seconds]
<Josh_2>
tomorrow I figure out ajax with hunchentoot :O hopefully that's possible
robdog has quit [Ping timeout: 252 seconds]
<Josh_2>
there is ht-ajax
quazimodo has quit [Quit: leaving]
quazimodo has joined #lisp
dmiles has joined #lisp
wanz has quit [Quit: wanz]
jack_rabbit has quit [Read error: Connection timed out]
jack_rabbit has joined #lisp
vilivulpine has joined #lisp
wanz has joined #lisp
robdog has joined #lisp
Kevslinger has quit [Quit: Connection closed for inactivity]
robdog has quit [Ping timeout: 252 seconds]
<pillton>
Hah. There are eight new trivial-* projects in the latest quicklisp distribution.
quazimodo has quit [Ping timeout: 250 seconds]
<no-defun-allowed>
trivial-triviality
<no-defun-allowed>
or is that just called sharpsign-plus?
<pillton>
Hmmm.. pardon? You might have to hold my hand on that jump from trivial-triviality to sharpsign-plus.
<no-defun-allowed>
a very trivial-foo just does something like #+sbcl (sb-foo:foo ...) #+ccl (foo:foo ...) i suppose
robdog has joined #lisp
<pillton>
I think the early projects were like that.
<pillton>
early? older?
dmiles has quit [Ping timeout: 255 seconds]
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
dmiles has joined #lisp
Inline has quit [Quit: Leaving]
robdog_ has quit [Ping timeout: 252 seconds]
karlosz has joined #lisp
meepdeew has joined #lisp
akater has quit [Quit: WeeChat 2.3]
ggole has quit [Remote host closed the connection]
<beach>
Good morning everyone!
ggole has joined #lisp
meepdeew has quit [Ping timeout: 255 seconds]
<no-defun-allowed>
ok, i killed my Pi trying to use $1 coins as a heatsink, so no more installing CCL for today ):
robdog has joined #lisp
<gilberth>
beach: Good night!
Oladon has joined #lisp
nanoz has quit [Ping timeout: 255 seconds]
makomo has joined #lisp
<no-defun-allowed>
(okay, the pi didn't die, it was just being stupid, so back to figuring out how to stop it from throttling)
pankajgodbole has joined #lisp
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
andrei-n has joined #lisp
robdog_ has quit [Ping timeout: 252 seconds]
pankajgodbole has quit [Ping timeout: 252 seconds]
JohnMS_WORK has joined #lisp
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
makomo has quit [Ping timeout: 268 seconds]
meepdeew has joined #lisp
<fiddlerwoaroof>
morning beach
robdog has joined #lisp
meepdeew has quit [Ping timeout: 245 seconds]
robdog has quit [Ping timeout: 252 seconds]
jack_rabbit has quit [Ping timeout: 245 seconds]
meepdeew has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
nanoz has joined #lisp
ggole has quit [Remote host closed the connection]
ggole- has joined #lisp
<flip214>
no-defun-allowed: I used a 32-bit sbcl (no threads, though) on my Pi1.
<no-defun-allowed>
I see. I'd like to use all 4 cores, so I'm running CCL right now.
meepdeew has quit [Ping timeout: 268 seconds]
<no-defun-allowed>
It seems to have some random moments of lossage, including type confusion, entering the low-level debugger, and just stopping despite having work to do.
<no-defun-allowed>
I think this is a problem with my overclock though, not with CCL.
<gilberth>
no-defun-allowed: What are you trying to do? Or put otherwise: Are you sober?
robdog has joined #lisp
juristi has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
<no-defun-allowed>
I'm just using lparallel to play chess. I don't think there's any cause for low-level breakage in there.
ggole- has quit [Remote host closed the connection]
jprajzne has joined #lisp
<no-defun-allowed>
I'm definitely sober, though.
ggole has joined #lisp
<gilberth>
no-defun-allowed: I am not definitely. Sorry, sounded like that. Cannot you trade stocks instead of playing chess?
<no-defun-allowed>
Sure, I also have a stock trading program (:
scymtym has quit [Ping timeout: 246 seconds]
<gilberth>
Oh, you have?! That is great. Does it fair well?
shka_ has quit [Quit: WeeChat 1.9.1]
<no-defun-allowed>
I'm too young to trade, but I did give it the constraints for a simulation we have at school (which does have real-money prizes), and about half the time on test data from about 1997 to 2017, it beats the record.
shka_ has joined #lisp
<no-defun-allowed>
(It makes around 30% profit in 100 days, but I think the simulator simulator is a little off.)
<gilberth>
Well, 20% per year is very reasonable.
<gilberth>
This is, what I do on average.
<no-defun-allowed>
I think that's around 160% profit/year.
<gilberth>
Yes, if you extrapolate your 30% per 100 days, it is.
<no-defun-allowed>
But the email didn't come around asking for registration, so I suppose we aren't doing it this year. Maybe they expect us to actually be preparing for exams, or something remotely school-related.
* gilberth
is puzzled now.
<no-defun-allowed>
From memory, it does get pretty close to extrapolated values over longer periods of time.
robdog has joined #lisp
<gilberth>
#lisp is quiet right now, isnt it?
<no-defun-allowed>
I figure the Americans are in bed now, and the Europeans have just woken up.
<gilberth>
You usually calculate with 7% per year. And you usually calculate with 4% per year, which you could withdraw from your fortune per year for a living.
<gilberth>
I suffer from DSPS, which is delayed-sleeping-phase-syndrome. I sleep six hours later than the rest of the people.
<no-defun-allowed>
Trading doesn't sound like a fun day job though, given that anyone can write a program to do it much better than a human.
<gilberth>
I am hoping to find a program to do that better than me.
robdog has quit [Ping timeout: 252 seconds]
<no-defun-allowed>
I think my simulator is broken, though, since the gains seem much too high, given I'm just using a normal RSI...indicator. RS indicator? I think the I in the acronym is "indicator".
<gilberth>
My idea is: Day-traders read news. And they base their decisions on what they read. A simple neural network would be suffice to model that.
<no-defun-allowed>
Sure.
<no-defun-allowed>
God forbid you try to explain what it does, though.
robdog has joined #lisp
<gilberth>
Like a few month ago. I was invested in AMD. There was some news about exploits in the Intel processor. Yet those news triggered some news and AMD sank too.
<no-defun-allowed>
How? Surely other CPU manufacturers would have gone up.
<gilberth>
Computer programs?
<gilberth>
99% of trading is automated now.
Oladon has quit [Quit: Leaving.]
<gilberth>
We both sweeties are by far not the first persons to think about automated trading. Dear.
<no-defun-allowed>
Of course we're not.
<gilberth>
See.
<gilberth>
I am still invested in AMD. One trick is not not panic.
robdog has quit [Ping timeout: 252 seconds]
<gilberth>
I wonder, if an AI could do that.
sauvin has joined #lisp
<no-defun-allowed>
There are more novel uses for programs, which I'd rather look into.
<no-defun-allowed>
(An AI wouldn't panic to start with.)
<gilberth>
An AI would very well panic. We face stop-losses for instance. And sell-off events.
<no-defun-allowed>
Well, I beat my program at chess, after a very thrilling half-hour match.
akoana has left #lisp [#lisp]
Posterdati has quit [Read error: Connection reset by peer]
<no-defun-allowed>
It does not recognise it is in check, which probably made it easier. I should fix that later.
<no-defun-allowed>
It also doesn't understand contextful moves like castling and en passant captures, so it doesn't really play chess either.
robdog has joined #lisp
Posterdati has joined #lisp
ggole has quit [Remote host closed the connection]
Posterdati has quit [Client Quit]
robdog has quit [Ping timeout: 252 seconds]
Posterdati has joined #lisp
heisig has joined #lisp
robdog has joined #lisp
<verisimilitude>
I'd figure automated trading works best when you have inside information you ostensibly don't have, like all of the major firms in all likelihood do.
<verisimilitude>
It also helps when you can say ``Do over!'' and have your machine's erroneous trades undone; I believe it was Goldman Sachs that got to do this, coincidentally.
<shka_>
verisimilitude: that's illegal
robdog has quit [Ping timeout: 252 seconds]
scymtym has joined #lisp
<verisimilitude>
Take it with a grain of salt, shka_; I've not dug particularly deep in ``verifying'' the beliefs I wrote, as they're just hearsay, not that you should believe me if I claimed to have done so, anyway.
<shka_>
verisimilitude: that's ok, i just want to point out that "inside trading" is prohibited by law
<no-defun-allowed>
shka_: it's not illegal if you have enough invested!
<verisimilitude>
I know; that doesn't mean it doesn't happen anyway, though.
<gilberth>
verisimilitude: It works best, when all other are just idiots. In the long run the fundamentals win.
Cymew has quit [Ping timeout: 246 seconds]
<verisimilitude>
Yes, gilberth, eventually the US society will go the way of the USSR and collapse as well.
<gilberth>
verisimilitude: It won't. Trump is history by two years or something about that.
<heisig>
Lispcafe?
<gilberth>
heisig: Coffee would be fine, do you make me some?
<verisimilitude>
Back to automated trading, it all looks like nonsense.
<no-defun-allowed>
No, but it'd be wise to go to #lispcafe.
<verisimilitude>
What, so automated trading too?
<verisimilitude>
I'll just drop it, then.
<no-defun-allowed>
Yes, talk on trading probably belongs there.
<no-defun-allowed>
Unless you know any stuff that makes it much better in Lisp, I suppose.
<shka_>
well chances are that it may be better in lisp
<gilberth>
It is not non-sense. There is much automatic trading going on. You tell me again, if you're not invested and are not hurted my silly news, that some robots react upon.
<gilberth>
by, even.
<verisimilitude>
I have a network issue with Common Lisp, which is a nice topic to segue into.
<shka_>
verisimilitude: yeah?
robdog has joined #lisp
<verisimilitude>
Well, I took a look at USOCKET and it's basically just the BSD Socket API abstracted.
<verisimilitude>
I can't write that I like it, from what I know; I'd prefer there be some other option, but it looks like I'd need to write that myself if I want it.
<no-defun-allowed>
SOCKET-CONNECT is quite sugared.
<verisimilitude>
I don't know the inner workings of the Genera network system, but that's what I'd look at first for inspiration.
<no-defun-allowed>
I think it's quite a bit better than just BSD sockets, Chicken Scheme has a library like that and it's worse.
<verisimilitude>
It looks like the same basic API to me, perhaps made more Lispy.
<no-defun-allowed>
Maybe if closing the stream closed the socket, I'd be a little happier, but then what constitutes a shutdown(3) call? I'm not sure how the semantics there would work.
robdog has quit [Ping timeout: 252 seconds]
themsay has quit [Ping timeout: 245 seconds]
<shka_>
verisimilitude: such library would be quite nice to have, that i am sure
<shka_>
personally i wanted to make sugar coated layer upon zeromq
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
hhdave has joined #lisp
pankajgodbole has joined #lisp
themsay has joined #lisp
robdog has joined #lisp
slac-in-the-box has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
spoeplau has quit [Ping timeout: 245 seconds]
Posterdati has joined #lisp
wanz has quit [Quit: wanz]
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
<jackdaniel>
did I hear coffee? :)
<jackdaniel>
coffee-lisp sounds like a nice readtable name
<heisig>
That readtable could insert calls to (make-coffee) and (drink-coffee) at random locations an the source code :)
<scymtym>
will the readtable prosper for a few years and then be displaced by type-lisp?
Fare has quit [Ping timeout: 255 seconds]
robdog has joined #lisp
<verisimilitude>
Is this some manner of in-joke?
robdog has quit [Ping timeout: 252 seconds]
<jackdaniel>
verisimilitude: CoffeeScript and TypeScript are both supersets of JavaScript
shrdlu68 has joined #lisp
<verisimilitude>
Oh, that.
<aeth>
I'm guessing that's in the same sense that C++ is a superset of C. Useful to think of it that way, but not quite the case.
<verisimilitude>
There's that nice quote: C++ is to C as lung cancer is to lung.
<shrdlu68>
What was that mechanism for seeing the macroexpansion of a form without evaluating it?
<verisimilitude>
Do you mean MACROEXPAND?
<verisimilitude>
There's also MACROEXPAND-1.
<jackdaniel>
shrdlu68: in slime you may try C-c M-e over the form
<jackdaniel>
it will expand it inline
<shrdlu68>
Yeah, thanks.
<verisimilitude>
To clarify, it was mine or jackdaniel's answer that helped?
<aeth>
macroexpand-1 tends to be more useful than macroexpand because macroexpand will go all the way, including implementation-specific macros that implement things that you probably shouldn't think about, like the internal details of DO or LOOP
karlosz has quit [Quit: karlosz]
robdog has joined #lisp
<verisimilitude>
The expansion of LOOP isn't deeply implementation-specific; it's even defined to expand into particular forms at the beginning.
<aeth>
It would have been nice (but probably too much work?) to have a macroexpand that stops at the standard forms.
<verisimilitude>
Well, you can build that with MACROEXPAND-1.
<verisimilitude>
More realistically, I suppose you'd just continually use MACROEXPAND-1 until you reached what you wanted to see.
karlosz has joined #lisp
karlosz has quit [Client Quit]
robdog_ has joined #lisp
<aeth>
Actually, thinking about it, it would have been easier to include it in the standard and implement it as part of the implementation of MACROEXPAND than to implement it on top of MACROEXPAND-1 because an implementation would just put in a check to see if it's in the package COMMON-LISP (with SYMBOL-PACKAGE) and terminate without expanding if it is.
<aeth>
When using MACROEXPAND-1 as a user you have to reimplement a lot of the already-written logic.
robdog has quit [Ping timeout: 252 seconds]
<aeth>
In particular, determining what to attempt to expand and what not to.
<verisimilitude>
I suppose. It would've been better to simply have a code walker with hooks provided by the language, I'd think.
robdog has joined #lisp
robdog_ has quit [Ping timeout: 252 seconds]
robdog has quit [Ping timeout: 252 seconds]
spoeplau has joined #lisp
<shrdlu68>
Was checking out the macroexpansion of with-open-file for an unwind-protect.
<shrdlu68>
When I'm using CL I take such elegance for granted, till I encounter something like Golang's defer mechanism.
marvin2 has joined #lisp
themsay has quit [Ping timeout: 240 seconds]
themsay has joined #lisp
robdog has joined #lisp
francogrex has joined #lisp
<francogrex>
Hi, I have a function to copy files
<francogrex>
(defun copy-bin (infile outfile)
<francogrex>
(with-open-file (in infile :direction :input :element-type 'unsigned-byte)
<francogrex>
(loop for inbyte = (read-byte in nil)
<francogrex>
while inbyte do
<francogrex>
(write-byte inbyte out)))))
<francogrex>
but I am looking for a function to move files like mv file newdir
<francogrex>
any hints?
robdog_ has joined #lisp
<francogrex>
i could use copy-bin and then delete-file infile, but that is not efficient as I will need to specify manually a outfile pathname each time
orivej has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
<francogrex>
rename-file works like that for binary files?
robdog_ has quit [Ping timeout: 252 seconds]
<jdz>
francogrex: Operating systems nowadays don't have a concept of binary vs. non-binary files.
<jdz>
francogrex: Also see alexandria:copy-stream.
lumm has joined #lisp
<jdz>
francogrex: If the problem is choosing the destination file then MERGE-PATHNAMES might be what you're looking for.
nanoz has quit [Read error: Connection reset by peer]
<Grue`>
francogrex: I don't understand what's wrong with rename-file. There's also probably something in uiop or cl-fad
<jackdaniel>
francogrex: be aware that rename-file may terribly fail when you move it between different logical devices (as in: when you copy the file)
<francogrex>
i don't understand. I don't copy I move
<jackdaniel>
lets say you have /dev/sda1 in /mnt1 and /dev/sda2 in /mnt2
<jackdaniel>
when you rename-file /mnt1/foo /mnt1/bar then all is fine, file is intact
<jackdaniel>
but you can't rename /mnt1/foo /mnt2/foo because file is not present on /dev/sda2
<jackdaniel>
you need to copy the file
orivej has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
<jmercouris>
is there a way to dynamically add a slot to an existing object without evaluating the class again?
<jackdaniel>
the most convenient way is to add a stealth-mixin
<jmercouris>
are you addressing m?
<jmercouris>
or someone else?
<heisig>
jmercouris: Another way is to store the added slot value in a weak hash table.
<jackdaniel>
I don't see other contextes which would fit the bill, yes
<jmercouris>
heisig: can you expand upon that?
<jmercouris>
jackdaniel: I can't see the conversation before I joined
<jackdaniel>
ah, that explains your question
<heisig>
jmercouris: If you just want to temporarily attach some information FOO to some objects, you can create a *FOO-table* mapping from objects to their FOO values.
robdog_ has joined #lisp
<jmercouris>
oh I see
<jmercouris>
well, that's not my problem
<jmercouris>
my problem is I have a Djula template
<jackdaniel>
stealth-mixin is a way to add 3rd-party class as one of the class ancestors after said class has been defined
<jmercouris>
and I want to add a value associated to an object
<scymtym>
jmercouris: should the slot be added to a particular instance or to all instances of a given class? also, how should the slot be accessed, using SLOT-VALUE or via an accessor?
<jmercouris>
I don't know how it will be accessed
<jmercouris>
I don't know what Djula does under the hood
robdog has quit [Ping timeout: 252 seconds]
<jmercouris>
however it allows me to say object.slot and returns the value
<jmercouris>
so I am led to believe that I must *add* a slot for it to work
<jmercouris>
unless I can simply call a method against my object, in which case I would define one, but I don't think I can
<jmercouris>
see, the slot, is actually a calculated value, we have a "Product" object, and we want the daily price of that product
<jmercouris>
so I could write (defmethod daily-price (product product) (/ (price product) 30))
<jmercouris>
and if I could call that from my Djula template, all would be fine and dandy
<jmercouris>
however, I believe I will need to add a slot...
<shka_>
how hard it would be to provide lisp bindings on top of it?
beaky has joined #lisp
<shka_>
what steps would need to be taken?
<shka_>
how to start?
ggole has joined #lisp
robdog has joined #lisp
<shka_>
i didn't use gobject before
<jmercouris>
scymtym: maybe
<jmercouris>
which library to use to parse decimal strings?
robdog has quit [Ping timeout: 252 seconds]
slac-in-the-box has quit [Remote host closed the connection]
<Grue`>
what's the best O(n) one-liner to find the first shortest string in a list?
<shka_>
reduce
<shka_>
also
<shka_>
what do you mean by shortest?
<shka_>
or rather
<shka_>
first shortest
<Grue`>
(reduce (lambda (x y) (if (<= (length x) (length y)) x y)) lst :from-end t) is the best I got so far
robdog has joined #lisp
<Grue`>
there can be several strings that are shortest. it should return the first one
<shka_>
why :from-end?
<shka_>
it should not be needed
<Grue`>
yeah i dunno
<Grue`>
would've been nice if min/max had a :key argument
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
robdog_ has quit [Ping timeout: 252 seconds]
<scymtym>
ALEXANDRIA:EXTREMUM is like that: (alexandria:extremum '("foo" "ba" "baaar") #'< :key #'length) => "ba"
dddddd has joined #lisp
<Grue`>
that could be useful
robdog has joined #lisp
robdog_ has joined #lisp
igemnace has quit [Quit: WeeChat 2.4]
robdog has quit [Ping timeout: 252 seconds]
orivej has joined #lisp
igemnace has joined #lisp
<ggole>
I'm surprised that isn't in loop. (loop for x in xs minimizing x by #'length)
<ggole>
I guess you can always add another special case.
robdog_ has quit [Ping timeout: 240 seconds]
<Grue`>
this is such a good idea, it deserves a CDR
robdog has joined #lisp
<_death>
it should also return the length
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
orivej has quit [Ping timeout: 240 seconds]
robdog_ has quit [Ping timeout: 252 seconds]
Lord_of_Life has quit [Ping timeout: 252 seconds]
Lord_of_Life has joined #lisp
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
Cymew has joined #lisp
Essadon has joined #lisp
robdog has joined #lisp
Kevslinger has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
python476 has quit [Remote host closed the connection]
robdog has quit [Ping timeout: 252 seconds]
phoe has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
orivej has joined #lisp
<shka_>
how can i find projects in quicklisp dependent on the cl-babel?
<_death>
ql:who-depends-on?
<shka_>
thanks!
<shka_>
heh, nil
<shka_>
great
<_death>
though those are only direct dependencies, it seems.. could use a recursive option
warweasle has joined #lisp
<shka_>
well, i just want to find decent example of how to read and decode binary stream char by char with cl-babel :(
JohnMS_WORK has quit [Read error: Connection reset by peer]
<scymtym>
shka_: is "cl-babel" the correct name? (ql:who-depends-on "babel") => <a bunch of systems>
JohnMS_WORK has joined #lisp
<shka_>
aaaah, right
robdog has joined #lisp
<shka_>
cl-babel is the repository name
<shka_>
but not the system name
nalkri has quit [Ping timeout: 246 seconds]
* dtw
doesn't like "cl-" prefix in system and packages names because we are already inside Common Lisp. Everything is "cl" there. It's fine in the outside world like git repository names.
robdog has quit [Ping timeout: 252 seconds]
wanz has joined #lisp
juristi has quit [Quit: Konversation terminated!]
robdog has joined #lisp
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
francogrex has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
robdog_ has quit [Ping timeout: 252 seconds]
<pjb>
dtw: there are things that are not cl-, but sbcl- or ccl- etc.
lucasb has joined #lisp
robdog has joined #lisp
xkapastel has joined #lisp
Inline has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
m00natic has joined #lisp
aeth has quit [Ping timeout: 245 seconds]
aeth has joined #lisp
<dlowe>
like... cl-user? ;)
<dlowe>
cl-common-lisp
Denommus has joined #lisp
phoe has joined #lisp
amerlyq has joined #lisp
FreeBirdLjj has joined #lisp
chrpape has joined #lisp
jmercouris has quit [Remote host closed the connection]
LiamH has joined #lisp
selwyn has joined #lisp
selwyn has quit [Remote host closed the connection]
Bike has joined #lisp
random-nick has joined #lisp
vilivulpine has quit [Quit: Using Circe, the loveliest of all IRC clients]
cranes has joined #lisp
robdog has joined #lisp
dreamcompiler has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
robdog_ has joined #lisp
robdog_ has quit [Ping timeout: 252 seconds]
spoeplau has quit [Ping timeout: 252 seconds]
wanz has quit [Quit: wanz]
Posterdati has quit [Read error: Connection reset by peer]
orivej has quit [Ping timeout: 252 seconds]
Posterdati has joined #lisp
Posterdati has quit [Client Quit]
Cymew has quit [Ping timeout: 245 seconds]
Posterdati has joined #lisp
robdog has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
robdog has quit [Ping timeout: 252 seconds]
hhdave has quit [Ping timeout: 250 seconds]
hhdave has joined #lisp
sjl_ has joined #lisp
hsrv has joined #lisp
shka_ has quit [Quit: WeeChat 1.9.1]
jprajzne has quit [Remote host closed the connection]
makomo has joined #lisp
scymtym has quit [Ping timeout: 240 seconds]
nalkri has joined #lisp
heisig has quit [Quit: Leaving]
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
xkapastel has quit [Quit: Connection closed for inactivity]
shrdlu68 has quit [Quit: WeeChat 2.3]
cage_ has joined #lisp
xkapastel has joined #lisp
jack_rabbit has joined #lisp
selwyn has joined #lisp
Fare has joined #lisp
jack_rabbit has quit [Ping timeout: 245 seconds]
<LdBeth>
Good morning
shka_ has joined #lisp
robdog has joined #lisp
Fare has quit [Ping timeout: 250 seconds]
varjag has joined #lisp
Ukari has quit [Ping timeout: 245 seconds]
cl-arthur has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
Oladon has joined #lisp
<beach>
Hello LdBeth.
Fare has joined #lisp
Ukari has joined #lisp
robdog has joined #lisp
micro has quit [Ping timeout: 244 seconds]
lumm has quit [Quit: lumm]
robdog has quit [Ping timeout: 252 seconds]
lumm has joined #lisp
pankajgodbole has quit [Ping timeout: 245 seconds]
lavaflow_ has quit [Ping timeout: 268 seconds]
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
micro has joined #lisp
Fare has quit [Ping timeout: 244 seconds]
robdog has joined #lisp
asarch has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
asarch has quit [Quit: Leaving]
ym555 has quit [Ping timeout: 252 seconds]
Fare has joined #lisp
matijja has joined #lisp
Khisanth has joined #lisp
* Xach
is updating quicklisp build system to debian 9 today, hopes to work out all the problems by april
* Xach
expects massive breakage!
<selwyn>
a friend of mine suggests that #lisp should call itself `the bracket racket'
<Colleen>
selwyn: drmeister said 4 hours, 29 minutes ago: I think it's buster but I'll verify and get back to you.
Fare has quit [Ping timeout: 240 seconds]
hhdave has quit [Ping timeout: 255 seconds]
CCDelivery has joined #lisp
andrei-n has quit [Remote host closed the connection]
selwyn has quit [Remote host closed the connection]
asarch has joined #lisp
SaganMan has joined #lisp
robdog has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
robdog has quit [Ping timeout: 252 seconds]
dreamcompiler has quit [Quit: dreamcompiler]
hsrv has joined #lisp
karlosz has joined #lisp
karlosz has quit [Remote host closed the connection]
akater has joined #lisp
ym555 has joined #lisp
Ampws has joined #lisp
gxt has joined #lisp
m00natic has quit [Remote host closed the connection]
Ampws has quit [Quit: leaving]
lavaflow_ has joined #lisp
robdog has joined #lisp
samlamamma has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
refpga has joined #lisp
CCDelivery has quit [Ping timeout: 245 seconds]
robdog has joined #lisp
Fare has joined #lisp
izh_ has joined #lisp
refpga has quit [Remote host closed the connection]
travv0 has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
matijja has quit [Ping timeout: 244 seconds]
cage_ has quit [Remote host closed the connection]
samlamamma has quit [Ping timeout: 255 seconds]
klltkr has joined #lisp
comborico1611 has joined #lisp
robdog has joined #lisp
<comborico1611>
Quick question, where is capital A, lowercase B in this output? (setq list1 (list "A" "b" "C" "d") list2 (list "a" "B" "C" "d"))
robdog has quit [Ping timeout: 240 seconds]
<buffergn0me>
comborico1611: That looks like input. Also looks like a homework question
orivej has joined #lisp
<comborico1611>
Nope. Trying to work through PAIP. One of the examples uses SET-DIFFERENCE. Hyper-spec example for SET-DIFFERENCE has this as the example, but I don't even understad the prelimiary to the example.
<comborico1611>
I think the Hyperspec has typos for this function or something.
karlosz has joined #lisp
themsay has quit [Ping timeout: 250 seconds]
<Bike>
example looks fine to me
<Bike>
i get ("A" "b" "C" "d") which matches the clhs (except in ordering, which is irrelevant here)
<Bike>
from (set-difference lst1 lst2) i mean.
dreamcompiler has joined #lisp
<Bike>
it uses set-difference with tests of varying approach to case sensitivity
micro has quit [Ping timeout: 250 seconds]
micro has joined #lisp
<comborico1611>
Bike: It says under description "set-difference returns a list of elements of list-1 that do not appear in list-2." But "d" and "C" appear in List-2
<Bike>
but the default test is eql
<Bike>
(eql "C" "C") => NIL, probably
karlosz has quit [Quit: karlosz]
<comborico1611>
Oh. Tricky.
<Bike>
with the later example with :test #'equal, you get ("A" "b") which may be what you were expecting
<Bike>
i couldn't tell you why clhs chose those particular function for this study of predicates though
SaganMan has quit [Quit: WeeChat 1.6]
robdog has joined #lisp
<comborico1611>
Bike: EQL is true if both characters that represent the same character. Wouldn't "C" and "C" be EQL?
<comborico1611>
Thank you! Thanks for clearing all this up. Now back to PAIP.
<Bike>
no problem
<comborico1611>
Interesting.
nalkri has quit [Ping timeout: 246 seconds]
Fare has quit [Ping timeout: 240 seconds]
comborico1611 has quit [Ping timeout: 244 seconds]
robdog_ has joined #lisp
sauvin has quit [Read error: Connection reset by peer]
robdog has quit [Ping timeout: 252 seconds]
random-nick has quit [Ping timeout: 240 seconds]
slac-in-the-box has joined #lisp
robdog_ has quit [Ping timeout: 252 seconds]
akoana has joined #lisp
asarch has quit [Quit: Leaving]
<pjb>
comborico1611: don't use SETQ, use LET! (let ((list1 (list "A" "b" "C" "d")) (list2 (list "a" "B" "C" "d"))) (find-if (lambda (list) (search '("A""b") list :test (function string=))) (list list1 list2))) #| --> ("A" "b" "C" "d") |# <-- it's here.
<Grue`>
it's annoying to use let when playing around in the repl. maybe he wants to experiment with list1 and list2 later
<aeth>
defvar/defparameter globally or let locally is like "var foo = 42;" and setq/setf is like "foo = 42;" so use defvar or defparameter for playing around in the REPL, setq on a new variable is UB afaik
<Bike>
it's taken from the clhs example.
<Bike>
which is old.
<pjb>
Grue`: I don't agree, as long as your REPL is in emacs. (eg. slime-repl). It's then very easy to edit, and to incrementally build a let form.
<pjb>
nanoz has joined #lisp
<aeth>
And I agree with pjb here. In SLIME you can use C-j instead of RET and have newlines and M-q to ensure indentation, and even turn on paredit in the repl buffer
<slac-in-the-box>
Let Over Lamda
<aeth>
So you can just repeatedly edit a form in the REPL
<Grue`>
nah that's silly
robdog has joined #lisp
<pjb>
Grue`: now, of course, you can just use a .lisp buffer as your REPL, with C-x C-e or C-u C-x C-e
<aeth>
90% of the time I wind up spinning it off into a separate file eventually
<fiddlerwoaroof>
slime-scratch is kind nice too
<fiddlerwoaroof>
Anyways, I build up extremely complex things in the repl using paredit + C-j and then copy them to files when I'm happy with them
ravenousmoose has joined #lisp
<Xach>
I start from files much of the time
<aeth>
I usually want to save the result in ~/notes or ~/programming for later, usually because it always comes up 8 months or so later on IRC.
<aeth>
Once it's more than a small form it goes there
lavaflow_ has quit [Ping timeout: 245 seconds]
<fiddlerwoaroof>
I just persist my slime history and make it huge
<fiddlerwoaroof>
I wish there was a better interface for searching it than M-p, though
<aeth>
I do that, too, but I can't rely on the history file to always be there. And even if it is, I can't be sure which computer I did it on.
<fiddlerwoaroof>
I should probably use dropbox or something to sync the history file around
<fiddlerwoaroof>
Or... write an actual history database :)
ealfonso has joined #lisp
<Grue`>
I almost never quit slime so slime-history is not very useful, because chances are my PC will crash or lose power before it's actually saved
robdog_ has joined #lisp
<aeth>
Syncing history might not be a good idea if you ever have e.g. a desktop and a laptop both open with their own SLIME REPLs open. I doubt the system was designed for handling this.
robdog has quit [Ping timeout: 252 seconds]
<aeth>
Actually, a lot of people probably also have a Raspberry Pi and might have remote servers and/or VMs so 2 might be too low of an estimate.
<aeth>
Other complicating factors would be e.g. a dual boot (Linux and Mezzano, of course, right?)
robdog has joined #lisp
robdog_ has quit [Ping timeout: 252 seconds]
<aeth>
I guess a private git repo of "scratch" stuff is probably the easiest solution even if sometimes you'll need history.
<aeth>
s/history/REPL history/
nanoz has quit [Quit: Leaving]
robdog has quit [Ping timeout: 252 seconds]
lavaflow_ has joined #lisp
hsrv has quit [Ping timeout: 240 seconds]
matijja has joined #lisp
comborico1611 has joined #lisp
robdog has joined #lisp
ggole has quit [Quit: Leaving]
lavaflow_ has quit [Ping timeout: 245 seconds]
robdog has quit [Ping timeout: 252 seconds]
ebrasca has quit [Remote host closed the connection]
amerlyq has quit [Quit: amerlyq]
robdog has joined #lisp
shka_ has quit [Ping timeout: 250 seconds]
polezaivsani has joined #lisp
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
nowhereman has joined #lisp
robdog_ has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
nowhereman has quit [Ping timeout: 245 seconds]
Arcaelyx has joined #lisp
comborico1611 has quit [Ping timeout: 268 seconds]
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
robdog has quit [Ping timeout: 252 seconds]
vlatkoB has quit [Remote host closed the connection]
hiroaki_ has quit [Ping timeout: 255 seconds]
robdog has joined #lisp
<akater>
re: form evaluation workflow, I write everything in org files emulating “notebook-style development”. Basically, I never use .lisp files anymore. That said, building fairly complex forms in SLIME is no problem, too.
<akater>
If only (1) org-edit-special wasn't necessary to activate lisp-mode, and (2) SLIME could insert presentations into org buffers, it would be quite seamless, as far as text-only notebooks go.
robdog has quit [Ping timeout: 252 seconds]
lavaflow_ has joined #lisp
robdog has joined #lisp
random-nick has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
cl-arthur has quit [Remote host closed the connection]
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
spoeplau has joined #lisp
robdog has joined #lisp
<Grue`>
hm, what kind of algorithm does remove-duplicates use with custom :test function?
robdog_ has quit [Ping timeout: 252 seconds]
<Grue`>
basically how is this fast? (time (remove-duplicates (alexandria:iota 1000000) :test (lambda (a b) (= (mod a 17) (mod b 29)))))
<Grue`>
(ignoring the fact that the comparison function is asymmetrical and thus the result makes no sense)
slac-in-the-box has quit [Remote host closed the connection]
matijja has quit [Ping timeout: 244 seconds]
<Bike>
there's the obvious O(n^2) algorithm
<Grue`>
yeah, but this scales linearly with iota parameter
slac-in-the-box has joined #lisp
<Grue`>
and the factor is the number of equivalency classes of :test function
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
<Grue`>
so for (lambda (a b) (= (mod a 17) (mod b 17))) there is 17 * N times comparison function is called
dreamcompiler has quit [Quit: dreamcompiler]
<Grue`>
though i guess it makes sense since the list of not-duplicates is at most 17 items long
Bike has quit []
<Grue`>
now this is actually super-slow (let ((cnt 0)) (remove-duplicates (alexandria:iota 100000) :test (lambda (a b) (eql a b)))) despite being equivalent to :test 'eql which is fast (using hash tables)
robdog_ has joined #lisp
Aruseus has quit [Remote host closed the connection]
robdog has quit [Ping timeout: 252 seconds]
robdog_ has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
<spoeplau>
Grue`: the comment in the SBCL implementation says "If we check from beginning we check into the rest of the original list up to the :end marker (this we have to do by running a do loop down the list that far and using our test." This seems to imply O(n^2), contradicting the evidence :P However, I'm not sure if there's some sort of special handling somewhere that I missed...
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
<sjl_>
Interesting. clhs remove-duplicates says > The elements of sequence are compared pairwise, and if any two match, then the one occurring earlier in sequence is discarded,