jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language<http://cliki.net/> logs:<https://irclog.whitequark.org/lisp,http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
Fare has quit [Ping timeout: 240 seconds]
slyrus2 has joined #lisp
slyrus2 is now known as slyrus
slyrus has quit [Ping timeout: 256 seconds]
slyrus1 is now known as 7GHAA3PAJ
wigust- has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
wigust has quit [Ping timeout: 264 seconds]
makomo has joined #lisp
beginner_supreme has joined #lisp
fikka has joined #lisp
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #lisp
Tristam has joined #lisp
fikka has quit [Ping timeout: 265 seconds]
moei has joined #lisp
fikka has joined #lisp
karlosz has joined #lisp
arubin has quit [Quit: Connection closed for inactivity]
Tristam has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 260 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
Tristam has joined #lisp
fikka has joined #lisp
dddddd has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 268 seconds]
karlosz has quit [Quit: karlosz]
<pillton> Bike: That spooky action thing is weird.
<Bike> it is a little weird.
<Bike> the reason it happens is that docstrings are associated with underlying functions rather than closures, of course.
<Bike> which i think is obviously reasonable except for this where it's a little weird.
zachk has quit [Quit: Leaving]
mareskeg has joined #lisp
itruslove has quit [Remote host closed the connection]
Guest28040 has quit [Remote host closed the connection]
<pillton> I am not sure I understand the difference between your example and https://plaster.tymoon.eu/view/824#824.
makomo has quit [Ping timeout: 240 seconds]
<Bike> In my example the two functions almost certainly have the same underlying, eh, code object.
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
Tristam has quit [Ping timeout: 276 seconds]
<Bike> they could in yours too i guess, but i doubt anyone would bother
eli_oat has joined #lisp
ealfonso has joined #lisp
fikka has joined #lisp
<ealfonso> perhaps not a good idea, but in defstruct is it possible to spcify a default init form that uses a previously defined slot? is there a way to access "this"?
<Bike> there isn't, but you could define a constructor that uses another parameter as a default
<aeth> Whenever I do anything fancy with struct initialization, I tell it to make the constructor a %make-foo and I write my own make-foo constructor using %make-foo
<Bike> or that.
<devon> (format nil "~,6F" 3738064606071093/1000000) => "3738064600.000000" ; I'd prefer "3738064606.071093"
<Bike> don't use floats?
<aeth> it's probably doing (float 3738064606071093/1000000) under the hood
<aeth> that gives me 3.7380646e9
<aeth> You want a double float
<aeth> Manually do (float 3738064606071093/1000000 1d0)
eli_oat has quit [Quit: Leaving.]
<aeth> (format nil "~,6F" (float 3738064606071093/1000000 1d0)) => "3738064606.071093"
fikka has quit [Ping timeout: 248 seconds]
<aeth> #'float is a bit awkward. It defaults to your default float format (in your case, and in most cases, that's single-float), but if you want to use another float format you have to provide some number of that format, in this case 1d0 (the "d0" instead of "e0" forces it to be a double)
<aeth> You can also do (coerce foo 'double-float) instead
<ealfonso> ok thanks Bike aeth
<aeth> Actually, apparently the default is always single-float. The difference between #'float and #'coerce is that #'float won't coerce something that is already a float.
Tristam has joined #lisp
<Bike> you might want to consider laying out the decimal yourself. it's kind of a pain, but it beats weird rounding unintuitiveness.
FreeBirdLjj has quit [Remote host closed the connection]
terpri has joined #lisp
<Bike> like (multiple-value-call #'format nil "~d.~d" (floor 3738064606071093 1000000)) i mean.
ealfonso has quit [Ping timeout: 260 seconds]
<Bike> ~d.~6,'0d
<aeth> I was about to say that that would eat the leading 0s
<aeth> If you do something like this you should probably write a unit test that compares it to the float version. They could differ, but if the decimal part differs by an order of magnitude or more, that's probably the leading 0s bug popping up or something similar
<devon> Thanks, (format nil "~,6F" (coerce 3738064606000000/1000000 'double-float)) sure beats (let* ((n 3738064606071093/1000000) (s 1000000) (sn (* s n))) (multiple-value-bind (q r) (floor sn s) (format nil "~D.~6,'0D" q r)))
<Bike> not fair, i made it a oneliner!
karlosz has joined #lisp
<Bike> if you already have a ratio you can just do (numerator ...) and (denominator ...)
itruslove has joined #lisp
<aeth> yeah, most of the time you use multiple-value-bind, you probably actually want multiple-value-call
<Bike> i wouldn't go that far.
<aeth> Seemed to be > 50% for me
<Bike> or rather i'd say that's actually false. i just didn't want to write too much.
<aeth> If you know about m-v-c obviously it'll be different percentage
giraffe has joined #lisp
giraffe is now known as Guest33711
fikka has joined #lisp
Tristam has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 248 seconds]
<pillton> Bike: Well, I think that documentation sharing thing is wrong. Imagine the surprises someone would have when using the programmatic interface to construct an environment. Secondly, an implementation may consider "compressing" code in fasls by sharing code objects.
scymtym has quit [Ping timeout: 264 seconds]
markoong has quit [Ping timeout: 245 seconds]
<pillton> Having said that, I am going to file it under apathy.
Kundry_Wag has joined #lisp
<Bike> mhm
<devon> THX² Bike, aeth: (let ((n 3738064606071093/1000000)) (string= (format nil "~,6F" (coerce n 'double-float)) (let ((s 1000000)) (multiple-value-call #'format nil "~D.~6,'0D" (floor (* s n) s))))) => T
<Bike> if you have a fraction already just do (format nil "~d~6,'0d" (numerator n) (denominator n))
<Bike> no, wait. that makes no sense.
<Bike> nevermind.
Pixel_Outlaw has joined #lisp
<aeth> devon: you wouldn't want string=, though, you'd want to find where the . is and then parse-integer and then divide the larger one by 10 until they're of the same base-10 length (but not quite beacuse you also have to take into account leading 0s) and then compare them.
<aeth> Because they could be subtly different due to floating point
<aeth> This is a case where the test is harder than writing the thing
milanj has quit [Quit: This computer has gone to sleep]
fisxoj has joined #lisp
<aeth> Bike's version will prefix 0 for leading 0's to get it up to 6, but if the part after the decimal point is longer than 6, it will display them all. Afaik, the double float version will always cut it off after 6 decimal places after the decimal point. So the lengths could differ.
scymtym has joined #lisp
rumbler31 has quit [Remote host closed the connection]
fikka has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
fisxoj has quit [Quit: fisxoj]
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
fikka has joined #lisp
<devon> Printing present-day universal times to µs, DOUBLE-FLOAT-EPSILON seems perilously close to dropping a low order bit. Perhaps it's time to define ~:F
pjb has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 260 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
light2yellow has joined #lisp
fikka has joined #lisp
cgay_ has joined #lisp
Tristam has joined #lisp
<devon> (format nil "~,,-6F, ~:*~,6,-6F" 1) => "1.0, 0.000001" ; is this a bug in CCL or a bug in the spec?
cgay_ has quit [Read error: Connection reset by peer]
cgay_ has joined #lisp
siraben has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
jxy has quit [Ping timeout: 268 seconds]
jxy has joined #lisp
cgay__ has joined #lisp
Tristam has quit [Ping timeout: 260 seconds]
johnvonneumann has joined #lisp
johnvonneumann is now known as Guest31678
<beginner_supreme> Not sure I understand destructuring-bind vs multiple-value-bind.
<Bike> destructuring bind takes lists apart. multiple value bind takes multiple values apart
<aeth> destructuring bind is most useful in macros. In fact, the lambda list of macros kind of builds it in to save a few levels of destructuring-binds.
FreeBirdLjj has quit [Ping timeout: 256 seconds]
Kundry_Wag has quit [Remote host closed the connection]
<aeth> a macro's lambda list might be (name (x y) &body body) and that's equivalent to it being (name parameters &body body) with a destructuring-bind in the macro of (destructuring-bind (x y) parameters ...)
Kundry_Wag has joined #lisp
Tristam has joined #lisp
fikka has joined #lisp
<aeth> So you're ensuring that a list matches some pattern, and binding the elements to that pattern. in (destructuring-bind (x y) (list 1 2) ...) x will be 1 and y will be 2. And (list) will be an error and (list 1 2 3) will be an error
<aeth> The structure in destructuring-bind can be complicated like (x (y &optional z) (u (v &rest w)) &key a b c)
Kundry_Wag has quit [Ping timeout: 240 seconds]
<aeth> With multiple-value-bind you're just dealing with a bunch of values. so (multiple-value-bind (a b c) (values 1 2 3) (+ a b c)) => 6
robotoad has quit [Quit: robotoad]
buffergn0me has joined #lisp
devon has quit [Ping timeout: 248 seconds]
fikka has quit [Ping timeout: 264 seconds]
<beginner_supreme> Thank you guys
<beginner_supreme> ->aeth
Tristam has quit [Read error: Connection reset by peer]
Tristam has joined #lisp
robotoad has joined #lisp
fikka has joined #lisp
oni-on-ion has quit [Read error: No route to host]
fikka has quit [Ping timeout: 268 seconds]
nickenchuggets has quit [Read error: Connection reset by peer]
devon has joined #lisp
nickenchuggets has joined #lisp
oni-on-ion has joined #lisp
AetherWind has joined #lisp
Kundry_Wag has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
nickenchuggets has quit [Read error: Connection reset by peer]
rumbler31 has joined #lisp
nickenchuggets has joined #lisp
nickenchuggets has joined #lisp
nickenchuggets has quit [Changing host]
shka_ has joined #lisp
pierpa_ has quit [Quit: Page closed]
fikka has joined #lisp
rumbler31 has quit [Ping timeout: 240 seconds]
Jesin has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
mareskeg has quit [Quit: mareskeg]
mareskeg has joined #lisp
mareskeg has quit [Client Quit]
fikka has joined #lisp
Kundry_Wag has quit [Ping timeout: 260 seconds]
kjeldahl has quit [Ping timeout: 245 seconds]
buffergn0me has quit [Ping timeout: 264 seconds]
eminhi has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
smurfrobot has quit [Remote host closed the connection]
Fare has joined #lisp
fikka has joined #lisp
surya has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
sauvin has joined #lisp
mingus has quit [Read error: Connection reset by peer]
mingus has joined #lisp
schoppenhauer has quit [Ping timeout: 260 seconds]
schoppenhauer has joined #lisp
sword` has quit [Remote host closed the connection]
fikka has joined #lisp
Bike has quit [Quit: Lost terminal]
siraben has quit [Quit: ERC (IRC client for Emacs 26.1)]
exit70 has quit [Ping timeout: 245 seconds]
Meow-J___ has quit [Ping timeout: 256 seconds]
trig-ger_ has quit [Ping timeout: 255 seconds]
rann has quit [Ping timeout: 256 seconds]
siraben has joined #lisp
rvirding has quit [Ping timeout: 256 seconds]
starman_jr has quit [Ping timeout: 276 seconds]
smurfrobot has joined #lisp
exit70 has joined #lisp
light2yellow has quit [Quit: light2yellow]
rann has joined #lisp
rvirding has joined #lisp
starman_jr has joined #lisp
trig-ger_ has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
tfb has quit [Ping timeout: 245 seconds]
stylewarning has quit [Ping timeout: 260 seconds]
zkat has quit [Ping timeout: 256 seconds]
banjiewen has quit [Ping timeout: 256 seconds]
johs has quit [Ping timeout: 255 seconds]
weltung has quit [Ping timeout: 256 seconds]
p_l has quit [Ping timeout: 256 seconds]
convexferret has quit [Ping timeout: 256 seconds]
l1x has quit [Ping timeout: 276 seconds]
jerme__ has quit [Ping timeout: 255 seconds]
tazjin has quit [Ping timeout: 256 seconds]
kilimanjaro has quit [Ping timeout: 256 seconds]
parseval has quit [Ping timeout: 256 seconds]
d4gg4d_ has quit [Ping timeout: 256 seconds]
travv0 has quit [Ping timeout: 260 seconds]
vmmenon has quit [Quit: vmmenon]
asedeno has quit [Ping timeout: 276 seconds]
CEnnis91 has quit [Ping timeout: 256 seconds]
jyc has quit [Ping timeout: 256 seconds]
mbrock_ has quit [Ping timeout: 276 seconds]
terrorjack has quit [Ping timeout: 276 seconds]
rme has quit [Ping timeout: 276 seconds]
adulteratedjedi has quit [Ping timeout: 276 seconds]
Duns_Scrotus has quit [Ping timeout: 256 seconds]
devlaf has quit [Ping timeout: 255 seconds]
billstclair has quit [Ping timeout: 276 seconds]
starman_jr has quit [Ping timeout: 245 seconds]
smurfrobot has quit [Remote host closed the connection]
mjl has quit [Ping timeout: 256 seconds]
splittist has quit [Ping timeout: 260 seconds]
<aeth> Wow, something other than Matrix failed this time.
rvirding has quit [Ping timeout: 245 seconds]
gendl has quit [Ping timeout: 276 seconds]
trig-ger_ has quit [Ping timeout: 260 seconds]
rann has quit [Ping timeout: 260 seconds]
exit70 has quit [Ping timeout: 260 seconds]
Kaisyu has quit [Ping timeout: 245 seconds]
angular_mike_ has quit [Ping timeout: 256 seconds]
jhei has quit [Ping timeout: 256 seconds]
XachX has quit [Ping timeout: 256 seconds]
danlentz has quit [Ping timeout: 276 seconds]
gz has quit [Ping timeout: 276 seconds]
Kevslinger has quit [Ping timeout: 245 seconds]
drmeister has quit [Ping timeout: 256 seconds]
tobel has quit [Ping timeout: 276 seconds]
alms_clozure has quit [Ping timeout: 276 seconds]
thinkpad has quit [Ping timeout: 240 seconds]
bailon has quit [Ping timeout: 260 seconds]
vibs29 has quit [Ping timeout: 240 seconds]
surya has quit [Remote host closed the connection]
bailon has joined #lisp
thinkpad has joined #lisp
vibs29 has joined #lisp
<beach> Good morning everyone!
Fare has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
shangul has joined #lisp
stnutt has quit [Ping timeout: 276 seconds]
stnutt has joined #lisp
Pixel_Outlaw has quit [Quit: Leaving]
fikka has quit [Ping timeout: 276 seconds]
surya has joined #lisp
cgay__ has left #lisp [#lisp]
cgay_ has left #lisp [#lisp]
marusich has joined #lisp
<beginner_supreme> good morning beach
fikka has joined #lisp
housel has quit [Remote host closed the connection]
housel has joined #lisp
sword has joined #lisp
<beach> beginner_supreme: So how is learning Common Lisp going?
fikka has quit [Ping timeout: 256 seconds]
smurfrobot has joined #lisp
<beginner_supreme> It's going well. Getting more used to it
<beach> Excellent!
<beginner_supreme> Other high level languages are beginning to feel lacking tbh
<beginner_supreme> Idk
<beach> Yeah, that's a phenomenon that many of us have observed.
fikka has joined #lisp
smurfrobot has quit [Remote host closed the connection]
shangul has quit [Ping timeout: 256 seconds]
asarch has joined #lisp
<beginner_supreme> Started learning emacs as well.
<beach> Good. Then, if you use ERC for IRC discussions, you can use Emacs abbrevs, so that when you type "tbh" or "idk", they will be automatically expanded.
housel has quit [Remote host closed the connection]
shangul has joined #lisp
<beach> For instance, I have abbrevs for "Common Lisp", "Common Lisp HyperSpec", "Good morning everyone!", "(first) Climacs", "Second Climacs", "first-class global environments", "(admittedly small) family", etc. etc.
<beach> Saves A LOT of typing, and makes it less necessary to explain to others what you are trying to say.
fikka has quit [Ping timeout: 276 seconds]
eminhi has quit [Quit: leaving]
<beginner_supreme> That sounds interesting
<beginner_supreme> Excited to try out slime soon.
<beach> I once calculated how many hours per month my abbrevs for writing email saved me. It was considerable. For some reason, I am one of the few people I know who use Emacs abbrevs. Strange to me.
<beach> Oh, yes, SLIME is a must.
<beach> It is not fantastic, but it's the best we have.
<White_Flame> mentioning "abbrevs" multiple times in your literal text here is ironic
* pillton didn't know Emacs had support for abbreviations.
<beach> pillton: Wow!
<beach> White_Flame: Why is that?
<White_Flame> because you're talking about full non-abbreviated text appearing in what you communicate
<White_Flame> as you talk about abbrevs :0
<White_Flame> :)
<beach> White_Flame: It's a technical term. I guess you didn't know about them either. http://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html
<White_Flame> yes, I gathered that. It just comes across as unintentionally humorous
<beginner_supreme> Is there a document anywhere describing the swank protocol that slime uses? Can't seem to find an official doc
dieggsy has joined #lisp
Ukari has quit [Ping timeout: 240 seconds]
<beach> I also use Emacs abbrevs to fix some of my common typos. Like, my fingers seem unable to type "the", and they type "teh" instead. So I have an abbrev that "expands", the latter into the former. Same thing for "language" and "language".
<White_Flame> seems to be working well
<beach> It saves me several minutes per day to avoid having to backspace and fix.
<beach> Er, "language" and "langauge". It is hard to prevent Emacs from fixing. :)
<White_Flame> I really need pythong => python at my shell
<beach> I can see that.
<beach> You would have to define a shell alias for that.
<jach[m]> Have you been hypnotized by the Hasselhoff as well?
brendyn has joined #lisp
fikka has joined #lisp
brendyn has quit [Read error: Connection reset by peer]
eminhi has joined #lisp
<devon> beginner_supreme: The swank protocol is so deficient, I'd not even look unless you plan to replace it.
<pillton> devon: How is it deficient?
fikka has quit [Ping timeout: 255 seconds]
brendyn has joined #lisp
<beginner_supreme> I'm curious to know too now lol
Ukari has joined #lisp
<White_Flame> I'm offering money to anybody who will refactor SLIME such that the elisp portion is hosted by swank, allowing multiple connections to different deployed versions simultaneously
fikka has joined #lisp
<White_Flame> with the initially emacs-side code simply being a bootstrap to connect & download elisp
<White_Flame> local to the connection
<shangul> White_Flame, you should offer something more attractive than money
<shangul> like ice-cream!
<White_Flame> the ice cream is money flavor
<White_Flame> (tastes like a million hands have rubbed it)
<pillton> White_Flame: That would be fun considering emacs only has a single namespace.
<White_Flame> right, it'd all have to be lambdas stored in a lookup list or something
<shangul> but younger people don't understand what money is. they understand what ice cream and chocolate is
fikka has quit [Ping timeout: 240 seconds]
<White_Flame> shangul: you show your age. This is the place to reference avocado toast
<shangul> my age?
<beginner_supreme> Avocado is to be toasted?
<shangul> I'm 8 years old
<shangul> and I'll never go upper than 8
<White_Flame> but seriously, if anybody wants to tackle SLIME like that, PM me
fraya has joined #lisp
<beginner_supreme> One must first learn to PM.
<beginner_supreme> <-
<jackdaniel> beginner_supreme: you type /query White_Flame
<beginner_supreme> Oh, thanks
<shangul> jackdaniel, isn't that "/msg"?
<beginner_supreme> It seems the difference is that /msg cannot be seen by anyone else, but query is visible.
<shangul> beginner_supreme, visible to whom?
<beginner_supreme> The channel I presume
<shangul> beginner_supreme, no it isn't
<shangul> beginner_supreme, query in my client opens a new private window and optionally sends a message
<shangul> /msg just sends a message
fikka has joined #lisp
<jackdaniel> msg sends a message, query opens a new window (like a channel)
<beginner_supreme> I see, you're right
<shangul> however I don't remember if query was a standard IRC command
DataLinkDroid has quit [Quit: Alla prossima volta]
<jackdaniel> I don't know, but unless it doesn't work for him it is a valid answer ;-) /me moves along
nickenchuggets has quit [Read error: Connection reset by peer]
nickenchuggets has joined #lisp
devon has quit [Ping timeout: 264 seconds]
DataLinkDroid has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
dieggsy has quit [Remote host closed the connection]
<shangul> How to tell dotimes to count from 1 instead of 0?
<beach> shangul: Use LOOP instead.
<beach> shangul: (loop for i from 1 to ... do ...)
<shangul> okay so no way to tell it. I'll use if to not do anything if it was 0
<beach> No, don't do that.
<shangul> ?
<beach> Use LOOP instead.
<beach> shangul: Why do you want to start at 1?
<shangul> because I should loop from 1 to n not from 0 to n
vsync has quit [Quit: ZNC - http://znc.sourceforge.net]
<beach> Fine.
Kaisyu has joined #lisp
<shangul> I each time do (/ n i) so what will happen if it was zero?
vsync has joined #lisp
<shangul> beach, Yet I don't know why should I use "loop" instead of "if" and "dotimes"
<jackdaniel> shangul: loop provides you mechanism to do what you want
<beach> shangul: Because LOOP would be more idiomatic.
<jackdaniel> dotimes doesn't do that
<shangul> okay...
banjiewen has joined #lisp
fikka has joined #lisp
l1x has joined #lisp
<jackdaniel> on the other hand, if you are interested in your own looping construct, I'd argue that building your macro upon DO is more readable
housel has joined #lisp
travv0 has joined #lisp
<jackdaniel> s/looping/iteration/
<beach> jackdaniel: I think that would be premature in shangul's case.
stylewarning has joined #lisp
<shangul> I'm going with loop
kilimanjaro has joined #lisp
<shangul> I'm leave and I'm not gonna lock the screen. because I know no one here would be able to work with i3 :D
jerme__ has joined #lisp
<flip214> minion: memo for Fare: https://bbt.legi.cash/ has a typo: "Solution: Extract Everything from a Same Spec" => "*the* Same Spec"
<minion> Remembered. I'll tell Fare when he/she/it next speaks.
tobel has joined #lisp
mbrock_ has joined #lisp
convexferret has joined #lisp
adulteratedjedi has joined #lisp
rme has joined #lisp
<beginner_supreme> Loop is a dsl for looping/iterating. Quite useful, I haven't learned all the t
Kevslinger has joined #lisp
johs has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
<beginner_supreme> Good night all!
beginner_supreme has quit []
<flip214> too late to point to ITERATE
tazjin has joined #lisp
tfb has joined #lisp
zkat has joined #lisp
fraya has quit [Ping timeout: 240 seconds]
weltung has joined #lisp
billstclair has joined #lisp
danlentz has joined #lisp
devlaf has joined #lisp
splittist has joined #lisp
mjl has joined #lisp
Duns_Scrotus has joined #lisp
gz has joined #lisp
rvirding has joined #lisp
jhei has joined #lisp
shifty has joined #lisp
pierpal has joined #lisp
exit70 has joined #lisp
trig-ger_ has joined #lisp
fikka has joined #lisp
kjeldahl has joined #lisp
XachX has joined #lisp
XachX has quit [Changing host]
XachX has joined #lisp
skapata has quit [Remote host closed the connection]
SaganMan has quit [Ping timeout: 265 seconds]
rann has joined #lisp
exit70 has quit [Ping timeout: 265 seconds]
fikka has quit [Ping timeout: 264 seconds]
vhost_remote has quit [Ping timeout: 245 seconds]
exit70 has joined #lisp
Inline has quit [Quit: Leaving]
parseval has joined #lisp
rann has quit [Ping timeout: 260 seconds]
adulteratedjedi has quit [Ping timeout: 276 seconds]
rvirding has quit [Ping timeout: 265 seconds]
tazjin has quit [Ping timeout: 256 seconds]
trig-ger_ has quit [Ping timeout: 256 seconds]
exit70 has quit [Ping timeout: 260 seconds]
johs has quit [Ping timeout: 256 seconds]
l1x has quit [Ping timeout: 256 seconds]
tfb has quit [Ping timeout: 256 seconds]
rme has quit [Ping timeout: 276 seconds]
danlentz has quit [Ping timeout: 276 seconds]
travv0 has quit [Ping timeout: 256 seconds]
banjiewen has quit [Ping timeout: 256 seconds]
splittist has quit [Ping timeout: 256 seconds]
Kevslinger has quit [Ping timeout: 276 seconds]
gz has quit [Ping timeout: 265 seconds]
convexferret has quit [Ping timeout: 256 seconds]
parseval has quit [Ping timeout: 240 seconds]
kilimanjaro has quit [Ping timeout: 276 seconds]
jerme__ has quit [Ping timeout: 276 seconds]
stylewarning has quit [Ping timeout: 276 seconds]
billstclair has quit [Ping timeout: 256 seconds]
XachX has quit [Ping timeout: 256 seconds]
Duns_Scrotus has quit [Ping timeout: 256 seconds]
mjl has quit [Ping timeout: 256 seconds]
mbrock_ has quit [Ping timeout: 256 seconds]
Kaisyu has quit [Ping timeout: 256 seconds]
jhei has quit [Ping timeout: 265 seconds]
devlaf has quit [Ping timeout: 265 seconds]
zkat has quit [Ping timeout: 276 seconds]
weltung has quit [Ping timeout: 276 seconds]
tobel has quit [Ping timeout: 276 seconds]
scymtym has quit [Remote host closed the connection]
slyrus has joined #lisp
SaganMan has joined #lisp
robotoad has quit [Quit: robotoad]
fikka has joined #lisp
fraya has joined #lisp
fikka has quit [Ping timeout: 276 seconds]
vhost- has joined #lisp
igemnace has joined #lisp
exit70 has joined #lisp
slyrus has quit [Ping timeout: 276 seconds]
7GHAA3PAJ is now known as slyrus
tazjin has joined #lisp
exit70 has quit [Max SendQ exceeded]
exit70 has joined #lisp
terrorjack has joined #lisp
exit70 has quit [Max SendQ exceeded]
exit70 has joined #lisp
trig-ger_ has joined #lisp
d4gg4d_ has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
ryanbw has quit [Remote host closed the connection]
eminhi has quit [Quit: ERC (IRC client for Emacs 26.1)]
adulteratedjedi has joined #lisp
rvirding has joined #lisp
alms_clozure has joined #lisp
banjiewen has joined #lisp
mjl has joined #lisp
starman_jr has joined #lisp
devlaf has joined #lisp
jerme__ has joined #lisp
Kaisyu has joined #lisp
Kevslinger has joined #lisp
asedeno has joined #lisp
rme has joined #lisp
tobel has joined #lisp
splittist has joined #lisp
Meow-J___ has joined #lisp
mbrock_ has joined #lisp
p_l has joined #lisp
drmeister has joined #lisp
danlentz has joined #lisp
MichaelRaskin has quit [Quit: MichaelRaskin]
parseval has joined #lisp
rvirding has joined #lisp
banjiewen has joined #lisp
weltung has joined #lisp
devlaf has joined #lisp
gz has joined #lisp
alms_clozure has joined #lisp
XachX has joined #lisp
l1x has joined #lisp
rvirding has quit [Changing host]
alms_clozure has quit [Changing host]
devlaf has quit [Changing host]
banjiewen has quit [Changing host]
mjl has joined #lisp
starman_jr has joined #lisp
mjl has quit [Changing host]
starman_jr has quit [Changing host]
devlaf has joined #lisp
devlaf has quit [Changing host]
jerme__ has joined #lisp
jerme__ has quit [Changing host]
vlatkoB has joined #lisp
zkat has joined #lisp
billstclair has joined #lisp
Duns_Scrotus has joined #lisp
isoraqathedh has quit [Remote host closed the connection]
angular_mike_ has joined #lisp
bexx has quit [Ping timeout: 276 seconds]
stylewarning has joined #lisp
Meow-J___ has quit [Max SendQ exceeded]
kilimanjaro has joined #lisp
tfb has joined #lisp
sveit has quit [Ping timeout: 256 seconds]
convexferret has joined #lisp
alphor has quit [Ping timeout: 256 seconds]
l1x has quit [Max SendQ exceeded]
angular_mike_ has quit [Max SendQ exceeded]
fikka has joined #lisp
jhei has joined #lisp
slyrus_ has joined #lisp
alphor has joined #lisp
Meow-J___ has joined #lisp
bexx_ has joined #lisp
vibs29 has quit [Ping timeout: 260 seconds]
l1x has joined #lisp
rann has joined #lisp
angular_mike_ has joined #lisp
sveit has joined #lisp
travv0 has joined #lisp
isoraqathedh has joined #lisp
Smokitch has joined #lisp
johs has joined #lisp
vibs29 has joined #lisp
fikka has quit [Ping timeout: 276 seconds]
fikka has joined #lisp
nowhere_man has quit [Ping timeout: 256 seconds]
marusich has quit [Quit: Leaving]
asarch has quit [Ping timeout: 276 seconds]
scymtym has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
gendl has joined #lisp
igemnace has joined #lisp
CEnnis91 has joined #lisp
jyc has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
kajo has joined #lisp
smurfrobot has joined #lisp
housel has quit [Ping timeout: 255 seconds]
mflem has quit [Read error: Connection reset by peer]
kajo has quit [Ping timeout: 240 seconds]
nickenchuggets has quit [Read error: Connection reset by peer]
nickenchuggets has joined #lisp
shka_ has quit [Ping timeout: 240 seconds]
doesthiswork has quit [Quit: Leaving.]
kajo has joined #lisp
varjag has joined #lisp
igemnace has joined #lisp
smurfrobot has quit [Remote host closed the connection]
varjag has quit [Remote host closed the connection]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
yangby has joined #lisp
yangby has quit [Client Quit]
makomo has joined #lisp
nickenchuggets has quit [Quit: Leaving]
dddddd has joined #lisp
shrdlu68 has joined #lisp
smurfrobot has joined #lisp
<shangul> flip214, why not using memoserv?
milanj has joined #lisp
slyrus_ has quit [Ping timeout: 260 seconds]
<beach> shangul: Because minion is written in Common Lisp? What is memoserv written in?
<shangul> no idea. but it does your job anyway
<shangul> Could I leave message for non registered users with minion?
<beach> I think so.
smurfrobot has quit [Remote host closed the connection]
unregistereduser has joined #lisp
<beach> minion: memo for unregistereduser: Hello
<minion> Remembered. I'll tell unregistereduser when he/she/it next speaks.
<unregistereduser> Hello minion.
<minion> unregistereduser, memo from beach: Hello
unregistereduser has left #lisp [#lisp]
<beach> shangul: Seems to have worked.
<shangul> MemoServ sends just to registered users
<beach> Good for it.
slyrus_ has joined #lisp
Cymew has quit [Remote host closed the connection]
Cymew has joined #lisp
nowhere_man has joined #lisp
random-nick has joined #lisp
<xificurC> aeth: why only defmacro supports this destructuring? Is there a particular reason (defun foo ((x y) &rest z) ...) isn't implemented in the standard but it is for defmacro?
fikka has quit [Ping timeout: 256 seconds]
lumm has joined #lisp
varjag has joined #lisp
<shrdlu68> xificurC: You can use destructuring-bind.
<xificurC> shrdlu68: of course you can. How does that relate to my question?
fikka has joined #lisp
schweers has joined #lisp
nowhere_man has quit [Ping timeout: 255 seconds]
housel has joined #lisp
<jackdaniel> xificurC: https://groups.google.com/forum/#!topic/comp.lang.lisp/J9SXofadB2c for a discussion about this
<shrdlu68> xificurC: I suppose what I meant was "because you could always use destructuring-bind", but I really have no concrete rationale.
orivej_ has joined #lisp
<xificurC> jackdaniel: thanks
terpri has quit [Ping timeout: 264 seconds]
orivej has quit [Ping timeout: 268 seconds]
<shrdlu68> Could it be because of #'apply? That's my best guess.
<shka> shrdlu68: i don't think that destructuring in function lambda list is a good idea to be honest
<shrdlu68> If function took destructuring lambda lists rather than ordinary lambda lists, there would be no way to pass lists to functions, would there?
<shrdlu68> I mean through #'apply.
<jackdaniel> so you say it is impossible to pass lists to macros? I highly recommend reading thread linked above
<shrdlu68> Hmm I've confused myself.
<_death> maybe because it promotes inefficient interfaces
wigust- has quit [Ping timeout: 264 seconds]
<jackdaniel> that's true that adding destructuring step to functions could hurt runtime performance
Bronsa has joined #lisp
jmercouris has quit [Remote host closed the connection]
_cosmonaut_ has joined #lisp
<shangul> code review request for idiomatic Lisp: https://apaste.info/Trw2
shrdlu68 has quit [Ping timeout: 245 seconds]
<jackdaniel> let* at the beginning is bad indented, you put first variable in the same line as the operator
<jackdaniel> there is no need for (n-divisors ()) , you can replace it with simply n-divisors (it defaults to ()), also if you insist, NIL is more readable than () [IMHO]
<_death> an extensible pattern matcher would let you extract just what you need from whatever kind of object so may be a better choice, but then there are various possible solutions and it's not something that was available to everyone historically
<jackdaniel> instead of (if test (progn …)) [it is one-branch if] use when which has implicit progn
<jackdaniel> (when test …)
<jackdaniel> other things seem fine at a glance
<jackdaniel> regarding this mod, you may also check it with (zerop (mod …)), but that's opinionated remark, nothing wrong with =
<shangul> NIL and empty list are the same?
<jackdaniel> yes
<shangul> and what do you mean by "one branch if"? if without else part?
<jackdaniel> yes
<jackdaniel> also seeing how you do two consecutive pushes, you could replace them with (setf n-divisors (list* (/ n i) i n-divisors)), but that's also a nitpick which is opinionated
<jackdaniel> list* creates a list with all elements, where last function argument is treated as list's tail
<jackdaniel> just like in (cons a foo) foo is treated as list's tail
<beach> jackdaniel: The advice about replacing (n-divisors ()) is not good. It should be replaced by (n-divisors '()) instead.
shrdlu68 has joined #lisp
<beach> shangul: The advice about replacing (n-divisors ()) is not good. It should be replaced by (n-divisors '()) instead.
<shangul> beach, why?
<beach> shangul: Using just n-divisors tells the person reading your code that you are going to assign to it before using it.
random-nick has quit [Ping timeout: 240 seconds]
<beach> shangul: Using () is not idiomatic because it is only used in code to indicate empty parameter lists.
<beach> shangul: Similarly, using NIL means that you are initializing it to the false Boolean value or to a default value.
<beach> shangul: And 'NIL means you are initializing it to the symbol NIL.
<beach> shangul: Only '() means you are initializing it to the empty list.
<shangul> what is difference between '() and ()?
<jackdaniel> '() may be considered as artificial as using eq instead of eql, so it is a matter of opinion
<beach> shangul: () is replaced by the symbol NIL by the reader, so () and NIL mean the same to the compiler.
<shangul> what about '() and ()?
<beach> shangul: When evaluated, both () and '() evaluate to NIL.
<beach> shangul: But the message to the person reading your code is different.
<beach> shangul: () means an empty parameter list as in (defun f () ...)
<beach> shangul: '() means an empty list.
<_death> shangul: ' is just a shorthand for (quote ...), so the first reads as (quote ()) and the second ().. they both evaluate to the same thing, but the first indicates to the programmer that you expect the thing to be evaluated to the empty list
<jdz> Also, it is inconsistent if for whatever reason one wants to pre-populate the list, in which case it would have to be quoted.
<beach> jackdaniel: I totally disagree.
<jackdaniel> I guessed so much
<beach> There is a very different message to the person reading the code, and that person should know as soon as possible what is going on.
<jackdaniel> I would hardly confuse () with parameter list when being initial value in let
<beach> shangul: You should use the contribution slime-indentation and put the DO LOOP keyword first on the line where the (IF is. Or rather where the (WHEN will be.
<beach> jackdaniel: Good for you. Others would.
<shangul> <jackdaniel> also seeing how you do two consecutive pushes, you could replace them with (setf n-divisors (list* (/ n i) i n-divisors)), but that's also a nitpick which is opinionated
<shangul> What about this?
<beach> shangul: Also use (zerop (mod n i)) instead of (= (mod n i) 0).
<beach> shangul: That's a very general rule: use the most specific construct that will do the trick.
<shangul> okay
<shangul> what about pushing to the list?
<beach> That's fine.
<_death> there is a name for the pattern (zerop (mod n i)) .. so I'd use a named function for it.. say divisible-by-p
<beach> ... as long as you initialize it with '(). :)
<shangul> I'm pushing more than one element in a time
<shangul> perhaps a better way?
<beach> shangul: jackdaniel suggested an alternative.
<shangul> which one's better or more idiomatic?
<beach> Both solutions are a bit clunky I think. I have no personal preference.
<shangul> jackdaniel, any you?
<shangul> and*
<jackdaniel> idiomatic has no real meaning to me. for beginners one way is idiomatic, for more advanced programmers other one is. it is very nicely explained in "learn ruby the hard way"
<jackdaniel> I wouldn't suggest it if I didn't consider it "better"
<shangul> okay
<jackdaniel> but I'm sure there is some crowd of 'others' who would find it worse
<_death> since you are using loop anyway, you could just use loop clauses WHEN and COLLECT
<shangul> I should read more about this loop thing
<beach> _death: Very good idea.
<makomo> what are the guidelines for naming CLOS accessors? i can't help but think that "process-context-instruction-pointer" is too verbose :^/
<makomo> the class is named process-context
<jackdaniel> loop is another interesting thing – some consider it being very lispy and others consider it being not lispy at all :)
<beach> makomo: I think it is a horrible idea to use the class name as a prefix. So I don't.
<beach> makomo: It gets silly when there is a lot of inheritance.
<makomo> beach: so if the accessor has a really short name, like "delayed", you just let it be?
<makomo> yeah, true
<jackdaniel> makomo: imagine it is a function having opaque argument, forget about the class thing
<jackdaniel> and name accessor accordingly
<beach> makomo: Yes, I just let it be.
<jackdaniel> in future you may consider replacing it with a method
<makomo> i have an even shorter one, "spec"
<makomo> jackdaniel: mhm
<beach> makomo: Take (sheet-parent stream), for instance. It seems silly to use an accessor for a sheet on a stream. But it's valid CLIM code.
imjacobclark has joined #lisp
<_death> shangul: you could also separate the algorithm from the printing of the results.. so you'd do something like (format t "Sum of divisors: ~A~%" (sum (divisors n)))
<shangul> _death, in this case I don't think it's necessary
<imjacobclark> could anybody help me understand why when encoding a list with cl-json my variable path ends up encoded as a literal string? (print (json:encode-json '#( ( ("bar" . path) (baz . #\!)))))
<makomo> beach: i see. is that because stream inherits from sheet?
<shangul> _death, because it's a small simple problem with a short code
<beach> Yes.
<beach> makomo: Yes.
<_death> shangul: in this case, it could be a bunch of PROG and SETQ since it's a very small snippet of no consequence.. but you asked for stylistic advice
<makomo> i guess i'll drop the prefixes then. i found them too verbose anyway.
<shangul> _death, yes you are right
<beach> makomo: Most people don't care that the slot and the accessor has the same name.
<shka> imjacobclark: this looks like bug, but what did you expect?
<beach> makomo: I personally dislike that, because I don't want client code to use SLOT-VALUE and I want to make that very clear.
<shka> json has no notion of lisp pair
<shka> maybe you should take this to the bug tracker
<beach> makomo: So I prefix the slot name with `%' which traditionally means "internal" or "dangerous".
<scymtym> makomo: beach's suggestion works best when combined with liberal use of packages (not in the :use sense). so e.g. my-compiler.ast:successor and my-compiler.cfg:successor instead of my-compiler:ast-parent and my-compiler:cfg-parent
<imjacobclark> shka: so given (print (json:encode-json '#( ((foo . (1 2 3)) (bar . path) (baz . #\!)) "quux" 4/17 4.25 ))) I got an output of [{"foo":[1,2,3],"bar":"path","baz":"!"},"quux",0.23529412,4.25]
<imjacobclark> where i actually expected the string "path" to be the value of the variable path, e.g "hello world"
<imjacobclark> and not the literal variable name, which is what I got
<makomo> beach: i see. and you do that for all of the slots, all the time?
<beach> makomo: Yes, I do. I always want to go through the accessor.
<jdz> This has not been an option? https://lpaste.net/5972552955990114304
<beach> makomo: That allows me to create internal protocols that can use the CLOS machinery with auxiliary methods.
<makomo> scymtym: i see. so creating packages that provide additional context. but wouldn't that get verbose quickly as well?
<makomo> i guess you can always USE the package if you need to cut down on the length temporarily
<beach> makomo: It's the other way around. If you don't do it, your code will quickly become a mess of mixed symbols.
<xificurC> shangul: you don't use n-sqr, so remove it. I would probably write (let* ((n (parse-integer (read-line t))) (divisors (for ... collect i collect (/ i n)... and then print. No need to push or setf when you are collecting into a fresh list anyway
<scymtym> makomo: to some extent. that's why many people want package-local nicknames
<xificurC> not for, but (loop for ... ) of course
<beach> makomo: I have stopped using :USE for packages other than COMMON-LISP.
<beach> makomo: Because when you :USE, you commit to future changes to the package.
<shangul> xificurC, I've done in the latest version
<shangul> xificurC, well just the sqrt thing
<jdz> shangul: There's my paste for your consideration, too.
<beach> makomo: And yes, scymtym is right, using package-local nicknames help a lot.
<shangul> jdz, which?
<makomo> beach: mhm, good point. so then you import the symbols that you need instead?
<makomo> or do you just use "cl:..."?
<beach> I do :USE the CL package.
<makomo> oh right
<makomo> woopsie
<beach> makomo: No, I would choose a short package local nickname and use explicit package prefix for the others.
<makomo> i see
<beach> Like CST:LISTIFY instead of concrete-syntax-tree:listify.
<scymtym> makomo: line 78 in https://techfak.de/~jmoringe/eclector-walk-and-source-tracking-simplified.html shows an example of this style
<scymtym> well, 78 and following
<makomo> i'll have to look into package-local nicknames then
<jdz> shangul: also, nobody seems to have complained about using APPLY instead of REDUCE.
<scymtym> makomo: note that they are not standard
<makomo> scymtym: yup
<jackdaniel> makomo: it has one drawback: it is implemented in ABCL and SBCL so far only
<makomo> only in those two?
<beach> makomo: I think they are becoming safe to use even though they are not standard. Most major implementations have them, and in the same way it seems.
<makomo> i thought it was more widespread
<jackdaniel> ECL has it in the develop branch
<shangul> jdz, I've used apply
<makomo> ah
<jackdaniel> CCL doesn't have them afaik at all
<jdz> shangul: yes, but you should have used REDUCE
<beach> jackdaniel: Oh, sorry. I thought it was in distribution of ECL.
<_death> names like frob-something or something-foo indicate type envy.. sometimes it makes sense to use that style, but you should consider using just frob and foo
<shangul> jdz, lemme see what this thing is
<jackdaniel> no, ECL's release cycle is much slower than SBCL (limited time resources ;)
<jackdaniel> but hopefully not as slow as CLISP
<scymtym> jackdaniel: will ECL implement the same variant of pln as SBCL or something else?
<jackdaniel> on the other hand release is the thing which I celebrate with friends (: rare occasion indeed
<makomo> beach: regarding your internal protocol comment, what exactly did you mean by "auxiliary methods"?
<beach> :BEFORE :AFTER :AROUND
<jackdaniel> scymtym: I've used Nikodemus proposal as the interface
<beach> clhs/g auxiliary-method
<beach> I can never remember how to do that.
<makomo> haha
<makomo> i understand what you mean now
<makomo> you benefit from the whole of CLOS by using accessors
<beach> makomo: Look in the clossary. Last entry in the A section.
<beach> Exactly.
<jackdaniel> so it is the same in principle (but package is ext if you want to use functions which work on packages -defpackage is extended accordingly to sbcl)
imjacobclark has quit [Ping timeout: 260 seconds]
flamebeard has joined #lisp
vibs29 has quit [Ping timeout: 260 seconds]
<scymtym> jackdaniel: i see. i asked because i think Xach designed/is designing another variant of pln
<beach> Oh, right. He objected to the SBCL way, right?
vibs29 has joined #lisp
mangul has joined #lisp
shangul has quit [Disconnected by services]
mangul is now known as shangul
<jackdaniel> is it going to be adapted in other implementations? since it's not released yet, I'm still free to change the interface
imjacobclark has joined #lisp
slyrus_ has quit [Ping timeout: 256 seconds]
<shangul> jdz, why should I use reduce instead of apply?
siraben has quit [Ping timeout: 264 seconds]
<beach> shangul: (reduce #'function list)
<shangul> I know
<shangul> but I don't know why
<beach> Oh, why?
<jdz> clhs call-arguments-limit
<beach> Because the number of allowed arguments to a function may be limited.
<scymtym> beach: jackdaniel: i'm not sure. best to ask Xach
<shangul> aha
<shangul> thanks
<shangul> all
orivej_ has quit [Ping timeout: 240 seconds]
<beach> shangul: When you do (apply #'+ list) you are subject to that limitation.
<imjacobclark> still baffled by "(json:encode-json '#( ((foo . (1 2 3)) (bar . path) (baz . #\!)) "quux" 4/17 4.25 ))" in cl-json - its as if it is just evaluating everything to strings and not the values
<shangul> because it does (+ a b c d...)
<beach> shangul: Yes.
<shangul> the final version: https://apaste.info/7X2P
<beach> shangul: Whereas REDUCE does (+ (+ (+ a b) c) d..)
<jdz> imjacobclark: Your array is quoted.
<shangul> beach, isn't reduce slower?
<beach> I doubt it.
<jackdaniel> scymtym: my question is rather: are sbcl devs willing to adopt this new interface?
<jdz> imjacobclark: Evaluate the array in the REPL, you'll see what the contents are.
smurfrobot has joined #lisp
<shangul> beach, ah it shouldn't be slower. because they produce the same machine code
<shangul> except push and pops to the stack
<xificurC> shangul: your n-sqr is not used anywhere. The LOOP that jdz posted is more natural then doing a let+push/setf combo
AetherWind has quit [Quit: Leaving]
<shangul> xificurC, oh yes I've forgotten to remove that
<jdz> shangul: Also consider providing :initial-value 0 to the REDUCE call.
<jdz> Unless you can prove that the list is never empty.
edgar-rft has quit [Quit: edgar-rft]
<shangul> if user enters a positive integer, it would never be empty
<scymtym> jackdaniel: can't say. firstly, i can't speak for all SBCL devs. secondly, i don't know enough about Xach's proposal
<jdz> shangul: "IF".
<shangul> however I updated the code: https://apaste.info/XNpd
<shangul> jdz, if they enter 0 or negative or non-numberic values. the program will crash
<jackdaniel> scymtym: thanks, that's understandable. thanks for the headups about Xach's work, I wasn't aware of it
<shangul> no it doesn't
<jdz> shangul: User input should always be sanitized.
smurfrobot has quit [Ping timeout: 240 seconds]
<shangul> jdz, right
<jdz> Oh, in this case the :initial-value is not needed because + already handles the case of zero arguments.
<jdz> Still, a thing to keep in mind when using REDUCE.
<makomo> beach: coming back to the accessor thing, does that mean you rarely use WITH-SLOTS?
m00natic has joined #lisp
<imjacobclark> jdz: ah I put it in quotes for IRC, it isn't in my code.
<jdz> imjacobclark: Array literal reader in Common Lisp does not evaluate the arguments.
<jdz> I learned that from Rich Hickey.
<imjacobclark> jdz: is there anything I can do to get around that?
slyrus_ has joined #lisp
<jdz> imjacobclark: Use MAKE-ARRAY.
<imjacobclark> Thanks!
<jdz> Or COERCE.
<imjacobclark> Array literal reader, is that essentially #'?
<jdz> #(
<imjacobclark> Ah yes.
<imjacobclark> Thankyou
<jdz> Another option is to use backquote.
<jdz> It has some interesting behaviour when combined with unquote-splicing, though.
beach has quit [Ping timeout: 255 seconds]
orivej has joined #lisp
MoziM has quit [Quit: WeeChat 2.1]
igemnace has quit [Read error: Connection reset by peer]
<xificurC> (funcall 'foo 2 3) generates the same assembly as (funcall #'foo 2 3), seeming the fdefinition of FOO is compiled in as a fixed memory location. I thought 'foo would be compiled as a runtime lookup. If one wanted runtime lookup one would need to use symbol-function?
Kaisyu has quit [Quit: Connection closed for inactivity]
orivej has quit [Ping timeout: 245 seconds]
orivej has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Remote host closed the connection]
<nirved> shangul: what happens when n is an exact square?
vlatkoB_ has joined #lisp
hhdave has joined #lisp
vlatkoB has quit [Ping timeout: 260 seconds]
igemnace has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
orivej has quit [Ping timeout: 264 seconds]
sbwhitecap has joined #lisp
<shangul> nirved, we will have 1 2 3 ... sqrt(n)
MoziM has joined #lisp
<shangul> oh no
<_death> xificurC: it is doing runtime lookup
<_death> xificurC: it is not always the case that the same code will be generated
terpri has joined #lisp
igemnace has quit [Quit: WeeChat 2.1]
<shangul> nirved, https://apaste.info/k3Fn
<xificurC> _death: what am I doing wrong then? http://ix.io/1e2e
<shangul> nirved, forget that
<loke> xificurC: What do you expect to happen?
<loke> I think that it's likely you don't understand lexical scope
<xificurC> maybe we think of something different when saying "runtime lookup"
<shangul> nirved, https://apaste.info/RO02
<loke> xificurC: You are wrong
<xificurC> loke: where does lexical scoping come into play here? FOO is special and flet should rebind it dynamically. The way I see it right now is that BAR is calling the previously defined FOO no matter what
<xificurC> loke: that is very likely :)
<loke> xificurC: FOO might be special (as a variable), but the function FOO isn't
<loke> The following gives an error, as FOO has no global binding:
<loke> (flet ((foo () (print 1))) (funcall 'foo))
<loke> Do you understand why that is the case?
fikka has joined #lisp
<loke> However, the following works, because #' looks up the function definition in the lexical scope:
<loke> (flet ((foo () (print 1))) (funcall #'foo))
<xificurC> if I redefine foo with defun then it picks up the change
<xificurC> loke: no I don't
<loke> Because DEFUN establishes a global binding of the function
<xificurC> loke: I always imagined I can interchange value and function lookup, i.e. (let ((foo 1)) foo) to work the same way as (flet ((foo () nil)) (funcall 'foo))
<_death> when a function name is passed to funcall, it uses fdefinition to look it up
<loke> FLED and LABELS establishes a lexical binding.
<_death> so the name comes from the global environment
<loke> xificurC: you can, in asense... BUT... there is a huge difference:
<_death> *the function
<xificurC> clhs flet
<loke> xificurC: Note that you pass the _symbol_ foo to funcall. It's FUNCALL that looks at the symbol and decides which function to call. Funcall isn't in the same lexical scope, so there is no way it could ever see your local definition.
<_death> although it's interesting that the funcall entry says "symbol" instead of "function name"
<loke> xificurC: with #' you pass the actual function to FUNCALL
<_death> (of course this contradicts my statement, and only symbols are dealt with that way..)
<xificurC> loke: ok so FLET makes lexical bindings, that was my mistake
<nirved> sbcl might inline #' and ' never gets inlined
<xificurC> clhs even states for noobs like me "Within the function definitions, local function names that match those being defined refer to functions or macros defined outside the flet"
<xificurC> loke: thanks, that cleared it up!
hvxgr has quit [Quit: leaving]
hvxgr has joined #lisp
orivej has joined #lisp
markoong has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
fikka has joined #lisp
shangul has quit [Ping timeout: 265 seconds]
fikka has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
jmercouris has joined #lisp
<jmercouris> I'm going through gentle introduction to symbolic computation, and I am stuck on this problem: https://imgur.com/a/rTOIRR1
<jmercouris> I understand why the example given is wrong, but I cannot think of how to solve the second part
<jmercouris> a generalized way of representing IF using just AND and OR
shangul has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
<jmercouris> I can't think about how to do it without using NOT
<schweers> jmercouris: does the text say you may not use NOT?
<makomo> the proble is that the true-part might return NIL right?
<schweers> or use progn, but that would be different from IF
<jmercouris> schweers: it doesn't say that, but it simply says "as a combination of ANDs and ORs that does not fail"
<jmercouris> schweers: progn hasn't been introduced in the book yet
<schweers> yeah, weird
fikka has joined #lisp
<jmercouris> I'm going through the book, imagining that I do not know things not yet introduced
<jmercouris> makomo: yes that is the problem
<jmercouris> at which point it would execute the second or clause
<schweers> okay, then we may assume that both frue-part and false-part are only one form (I hope)
<jmercouris> yes, this is the assumptino
<makomo> does this alternative definition of IF have to return the actual value of the true-part, or can it just return t?
<jmercouris> s/assumptino/assumption
<makomo> i.e. is it supposed to work with generalized booleans?
<makomo> or are just T/NIL fine?
<jmercouris> makomo: I'm not sure, all the information I have is what is listed
<jmercouris> I think the goal is just conditional execution and returning a correct boolean
<jmercouris> not necessarily the result of the expression
<jmercouris> like it needn't return 5 or "fish", just T like you've said
<makomo> perhaps something like (or (and 'test (or nil t)) 'false)?
<makomo> "nil" is the true-part
<jmercouris> makomo: It still has to execute the true branch
<jmercouris> oh I see
<jmercouris> you've put nil as a placeholder
<makomo> but it's wrapped within another OR that forces a T to be returned
<jmercouris> interesting
<makomo> yeah
smurfrobot has joined #lisp
<makomo> the second OR is never executed if 'test is something that returns NIL instead
<jmercouris> I came up with (or (and test true-branch) (and (not test) false-branch))
<makomo> ah
<jmercouris> but again, not sure I am allowed to use not
<jmercouris> it has been mentioned in the book, but the question is vague
<schweers> jmercouris: that would evaluate test twice, which may be relevant
<jmercouris> if there are side-effects, yes
<makomo> right
orivej has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 240 seconds]
<jmercouris> thanks for the feedback
<makomo> so it seems like this alternative definition is only good at selecting the right operation
<makomo> the return values are borked though
<jmercouris> yes
<jmercouris> I can't think of another way to do it though
<makomo> me neither
Bronsa has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
<shrdlu68> (or (and (oddp 5) (and (evenp 7) t)) 'foo)
<jmercouris> within (and (evenp 7) t) you'll never ever hit the second t block
<jmercouris> because if the first clause returns t it will jump to the second block and return "t"
<jmercouris> if the first clause returns nil, it will short circuit and return nil
<jmercouris> so you are still not getting back the result of the evaluation
<jmercouris> also in my first message, I did not mean to say "you'll never hit the second t block", I should have said, "you'll never get the evaluation result"
fikka has quit [Ping timeout: 255 seconds]
<shrdlu68> Oh, I thought the goal was to just return a boolean.
<jmercouris> I'm not sure, the question is really ambiguous
<jackdaniel> little late on the party, but: (or (or (oddp 3) 'foo) (and (oddp 3) (evenp 7))) ; if we are willing to evaluate test twice in worst case
<jmercouris> ah, very clever
<jackdaniel> so either (or (or TEST FALSE) (and TEST TRUE)) or (or (or TEST FALSE :nothing) TRUE)
<jmercouris> right, you flip the order
<jackdaniel> if we do not care if it returns NIL or :nothing
<jmercouris> so that you don't need to use a NOT
fikka has joined #lisp
<shrdlu68> Shouldn't we get the result of (evenp 7)?
fikka has quit [Ping timeout: 264 seconds]
<jmercouris> ah, shit, yes
<jmercouris> this would return 'foo, right?
<jmercouris> or rather foo
<jmercouris> this is getting confusing for me
<jmercouris> I'm going to start drawing truth tables in a bit lol
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
<nirved> there's no solution when test has side effects
fikka has joined #lisp
<_death> jackdaniel: if (oddp 3) returns true, the outer OR will just return that
<jackdaniel> you are right
<jmercouris> what's crazy is that this is only chapter 4 of this book
<jmercouris> I can't imagine how intimidated a new CS student would feel going through this book
<jmercouris> they are only 1/6 the way, and they have an unsolvable problem
<jmercouris> then again, they may not give credence to side-effects and the like
<_death> I think the naive solution jmercouris found is the one intended
<_death> that uses NOT and evaluates twice
<makomo> i would rather say that they didn't define the problem well enough
<makomo> i mean, they're too vague about what they expect
<makomo> should we care about side-effects? should we care about return values?
<makomo> who knows what they want
<_death> well, maybe they've not introduced side-effects yet
<jackdaniel> I think that having problems without solution is a very important lesson
<jackdaniel> they happen often in real-world scenarios
<jackdaniel> only in education they are rarity (what creates a misleading impression)
<makomo> meh, i don't like that reasoning at all because it only confuses the reader
<makomo> there's a certain math textbook with lots of math exercises but *NO* solutions at all
kajo has joined #lisp
<makomo> the rationale is that "a mathematician should get used to the unavailability of solutions"
<jmercouris> I already took software design classes in my undergraduate, and those were oftentimes ambiguous on purpose. I think the goal is to teach lisp, not generalized software engineering
<makomo> pretty dumb if you ask me
<nirved> there's answer in appendix c, it uses not
<jmercouris> there is a valuable lesson here, I just think this is the wrong book to teach it
random-nick has joined #lisp
<jmercouris> nirved: Ah, the answers are in the appendix, good to know ,thanks
Bronsa has joined #lisp
<makomo> _death: also, i think that the fact that side-effects can be ignored should be mentioned upfront, even if the book didn't get to side effects yet
<_death> AND and OR are insufficient.. maybe if there was a NAND operator ;)
<makomo> because many people don't really start with a clean slate when reading such books
<makomo> i.e. they'll immediatelly think "but what about multiple evaluation"
<makomo> and then just end up confused since the book says nothing about it
<_death> makomo: if they're actually reading the book they may notice that it's not yet introduced..
<makomo> i still think that it should be mentioned explictily
<_death> that would get in the way of understanding for people who don't know what side-effects are, which forms a big part of that book's target audience, I'd think
<makomo> instead of the book saying something like "ah remember that example? we didn't handle the problem of multiple evaluation then" later on
<makomo> hm idk, i guess it depends from person to person
<makomo> yeah, maybe
<_death> gentle introduction is gentle ;)
<makomo> hah, good point :D
<jmercouris> that would be an interesting title for a fast paced book
<jmercouris> "violent introduction to symbolic computation"
<_death> learn X the hard way?
<_death> learn X in 21 days
<makomo> X in Y <time-units>
<makomo> X for dummies
smurfrobot has quit [Remote host closed the connection]
<makomo> X for geniuses*
<shrdlu68> X for masochists.
<xificurC> how about (or (and test (or then t)) (or else nil))
<_death> ignores the return value of THEN.. last OR unnecessary
<shrdlu68> X for Von Neumann.
<xificurC> _death: I can't open the imgur link (blocked at work)
pierpal has quit [Quit: Poof]
<xificurC> so I'm not sure what the exact question is. But reading the discussions it was said the return value doesn't need to be kept. The last or isn't necessary but it is symmetric to the then part
SaganMan has quit [Ping timeout: 264 seconds]
pierpal has joined #lisp
doesthiswork has joined #lisp
<_death> xificurC: right, if only true or false are needed then your solution works..
fikka has quit [Ping timeout: 260 seconds]
scymtym_ has joined #lisp
<shrdlu68> xificurC: (or (and (oddp 5) (or (evenp 7) t)) (or 'foo nil)) => t
<shrdlu68> The test is (oddp 5), then is (evenp 7), else is 'foo
fikka has joined #lisp
<jackdaniel> if block/return are allowed, then it is possible to return values too, otherwise I think it is not possible without null/not
scymtym has quit [Ping timeout: 245 seconds]
<xificurC> shrdlu68: given that I understood code blocks are only to be run for side effects that looks correct
<shrdlu68> But the result ought to be the evaluation of (evenp 7), so it's wrong.
<xificurC> shrdlu68: then it's not run for side effects and yes, in that case it won't work
<shrdlu68> Unless there's a way to create NOT using AND and OR, I don't think this has a solution.
<shrdlu68> Proof by frustration.
SaganMan has joined #lisp
<makomo> exactly :D
fikka has quit [Ping timeout: 276 seconds]
andrei-n has joined #lisp
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
jmercouris has left #lisp ["Exit."]
fikka has joined #lisp
hvxgr has quit [Quit: leaving]
fikka has quit [Ping timeout: 256 seconds]
shangul has quit [Quit: sudo rm -rf /usr/*]
pierpal has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
hvxgr has joined #lisp
Folkol_ has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
markoong has quit [Ping timeout: 264 seconds]
markoong has joined #lisp
beach has joined #lisp
davsebamse has joined #lisp
<beach> makomo: Yes, correct. I use WITH-ACCESSORS instead.
fikka has joined #lisp
<makomo> beach: and what if some of these before/after methods contain error checking that is not necessary within internal functions
<beach> makomo: I try to split my protocols into external and internal.
<makomo> and you want to avoid that extra work, since you know you're providing correct values as the implementor
<beach> If I am really concerned, I make the external only do the error checking.
<makomo> i suppose the accessors are part of the external protocol? how do you name these internal accessors then?
<beach> No, not necessarily. I use accessors for everything, including internals.
doesthiswork has quit [Quit: Leaving.]
<beach> Not all accessor names are exported. The ones that aren't belong to some internal protocol.
fikka has quit [Ping timeout: 245 seconds]
Bike has joined #lisp
<makomo> beach: so in the case when you want to avoid error checking because hypothetically it might be expensive, do you have 2 accessors? a safe one which is part of the external protocol and an unsafe one which is part of the internal protocol?
<makomo> i suppose the difference isn't that clear though, since you might offer safe and unsafe versions as part of the external protocol?
<makomo> (instead of the unsafe version being stashed away within the internal protocol)
<beach> makomo: Two options then. Either stick two accessors for the same slot and use some auxiliary methods only on the externally visible accessor. Or make the external generic function not an accessor and have its method(s) call generic functions in the internal protocol.
doesthiswork has joined #lisp
sbwhitecap has quit [Ping timeout: 265 seconds]
<beach> makomo: I always work under the assumption that my stuff is fast enough, even with error checking. I design good data structures and algorithms to make that happen. So far, I have not had to make anything that is part of some external protocol "unsafe".
<beach> makomo: I usually design the external protocol first, and I decide what I want it to do.
fikka has joined #lisp
<makomo> beach: ah, i see. good point about good data structures and algorithms.
<makomo> that usually ends up being more important anyway
sbwhitecap has joined #lisp
<beach> makomo: Yeah, I rarely have to micro-optimize, and I always compile with speed 0, debug 3, compilation-speed 0, safety 3, space 0.
Fare has joined #lisp
<beach> makomo: Unless, of course my research is about highly optimized code, as in this one: http://metamodular.com/reverse-order.pdf
smurfrobot has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
<makomo> beach: very interesting, thanks for the material :-)
<beach> Anytime.
<beach> I didn't mean for you to read that.
<beach> Just to show you examples of exceptions to my rule about OPTIMIZE flags.
kuribas has joined #lisp
sbwhitecap has quit [Ping timeout: 255 seconds]
<kuribas> why does compiling: (defun f (x y) (declare (type fixnum x y)) (+ x (* y 2))) give me: forced to do GENERIC-+ (cost 10) ; unable to do inline fixnum arithmetic (cost 2) because: ; The second argument is a (INTEGER -9223372036854775808 ; 9223372036854775806), not a FIXNUM.
<makomo> beach: yeah, but it certainly serves as a good example for such cases
<kuribas> since I declared x y as a fixnum, I'd think (* y 2) is also a fixnum
<beach> kuribas: It is not.
<kuribas> beach: apparently
<beach> kuribas: If you take the biggest fixnum and double it, it won't be a fixnum.
<kuribas> I don't get why.
<beach> makomo: Sure.
<kuribas> beach: so can I do an "unsafe" double?
<beach> kuribas: What does that mean?
fikka has joined #lisp
<kuribas> like addition modulo 2^32
<makomo> i think you're looking for the "THE" form
<Xach> kuribas: you can use (mod (* y 2) 2^32)
<beach> kuribas: You can do that, but I don't see any point of using Common Lisp then.
<Xach> kuribas: or (logand #xFFFFFFFF (* y 2))
<kuribas> I just want efficient code.
<beach> kuribas: You might as well use one of the so many unsafe languages out there.
<Xach> SBCL can make such operations very efficient.
dieggsy has joined #lisp
<Xach> And semantically the same on all implementations, unlike fixnum declarations.
<shka> beach: well, sometimes you want integer to just overflow
<shka> like in the hashing function for instance
<Xach> Then you would use MOD or LOGAND or similar.
<Xach> Instead of implicit overflow.
<beach> shka: Then do it explicitly as Xach suggests.
sbwhitecap has joined #lisp
<Xach> SBCL (and possibly other implementations) will do efficient things with machine-word modular arithmetic.
<makomo> so what are the guarantees if one used THE to declare the type of the result?
<makomo> are there any guarantees regarding the behavior of fixnums (such as overflow, etc.)?
<_death> by using THE you are the one guaranteeing things
<Xach> makomo: they will be of a certain size.
pierpal has joined #lisp
<Xach> if you declare something a fixnum and it is not that size, things are allowed to break.
<makomo> i see
<beach> makomo: It is usually a very bad idea to guarantee something that isn't true.
fikka has quit [Ping timeout: 240 seconds]
warweasle has joined #lisp
<makomo> mhm
smurfrobot has quit [Remote host closed the connection]
<shka> makomo: thing is, all those type declarations are geared mostly toward efficiency first, and type safety secondly at best
smurfrobot has joined #lisp
<shka> so until you have program that works and is already debuged, you may prefer to skip manual type declarations
<shka> unless you know what you are doing
Folkol_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shka> and knowing what you are doing is often not portable
mareskeg has joined #lisp
<shka> if you want to make your program type safe, check-type is your friend
mindCrime has joined #lisp
<shka> deftype is cool as well
gabiruh has joined #lisp
gabiruh has quit [Client Quit]
BitPuffin has joined #lisp
fikka has joined #lisp
gabiruh has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
flamebeard has quit []
<_death> (you can also declare speed 3 if you want)
<jdz> I declare types and safety, so I get errors when my assumptions turn out to be wrong.
<beach> jdz: That's not portable though.
fikka has quit [Ping timeout: 245 seconds]
<jdz> I should read the relevant sections of the spec, then.
<kuribas> So I understand correctly that there is no type which have the semantics of machine integers?
<Xach> kuribas: that's right.
<kuribas> That is, wrapping around on overflow.
<jdz> kuribas: what machine?
<Xach> If you want wrapping, you must write it with arithmetic operations.
<Xach> like MOD or LOGAND
<kuribas> jdz: almost all CPUs?
<beach> jdz: Maybe in WSCL, I will be more strict about the meaning of type declarations, especially in safe code.
<Bike> kuribas: i mean, there's sizes to worry about.
<jackdaniel> speaking of portability, it still won't be portable (but rather wscl-specific)
<kuribas> Bike: let's say 29 bits or more.
<Bike> kuribas: but integers act like integers. semantics aren't determined by type in lisp. if you want arithmetic modulo whatever, you write the modulo yourself, and your compiler can try to lower that to machine arithmetic (sbcl does so)
<shrdlu68> How I learned to stop worrying and embrace the implementation.
dieggsy has quit [Remote host closed the connection]
<beach> jackdaniel: It would be portable across all WSCL-conforming implementations. :)
<kuribas> embrace the lack of performance
eli_oat has joined #lisp
<jackdaniel> so jdz's behavior is portable across all SBCL-conforming implementations? ;-)
<beach> jackdaniel: Heh!
<Xach> kuribas: it's a trade-off.
<beach> kuribas: Embrace safety. That's part of the beauty of Common Lisp.
<kuribas> how is wrapping around unsafe?
fikka has joined #lisp
<Bike> it causes problems when programmers don't expect to wrap.
dieggsy has joined #lisp
<beach> kuribas: Oh, it's safe if you carefully check for it each time. Now look at how many C programs assume that x + 1 > x.
<_death> kuribas: what lack of performance? if you have speed 3 it's a shl and an add as it's supposed to be..
<jackdaniel> beach: that reminds me of this comic: https://xkcd.com/927/
<Bike> like old video games where you heal a bunch and end up with negative four million health
<beach> jackdaniel: Good one!
<kuribas> _death: and a test it doesn't overflow
<_death> kuribas: nope
gabiruh has quit [Quit: ZNC - 1.6.0 - http://znc.in]
jack_rabbit has quit [Ping timeout: 264 seconds]
gabiruh has joined #lisp
<xificurC> kuribas: wrapping might be desired in *some* cases. It's not how the world works. Or do you suddenly have 0 apples when you buy 1 more but your basket is full
<makomo> beach: in the case of signed integers, that is actually always true and could be optimized out by the compiler :-)
<xificurC> if you want to write assembly or C, write assembly or C. Don't expect a high level language to magically generate the tightest code possible
<makomo> beach: since signed overflow is undefined
<beach> makomo: Fair enough.
<makomo> there was a bug report on GCC's issue tracker where one guy was mad when GCC started making use of that optimization
<_death> I don't understand why people suggest switching to a different language.. sbcl is sufficient here.. and if you still want more performance, just write your assembly routines in lisp :)
<makomo> the GCC guys didn't seem to care though -- rely on UB and that's what you get
fikka has quit [Ping timeout: 260 seconds]
<xificurC> _death: it feels natural when one is trying to get language X's behavior in language Y
<kuribas> xificurC: depends on the high level language I get.
<shrdlu68> xificurC: Good luck writing more efficient asm by hand than sbcl.
<_death> xificurC: Lisp can serve well as both a high level language and a low level one
<xificurC> _death: many languages can. But if you want to write low level only, why bother?
<_death> shrdlu68: that wouldn't be so hard..
<beach> _death: You are right of course. But it seems kuribas is pouting because Common Lisp is not unsafe by default like other languages are.
<kuribas> beach: not by default
<_death> beach: I think kuribas did just that the other day as well.. and the answers were also similar
<xificurC> shrdlu68: why are people under the impression writing good asm by hand isn't possible anymore? Make a few web searches
jmercouris has joined #lisp
<beach> _death: It makes me tired. Especially today when I am in a rotten mood.
dieggsy has quit [Remote host closed the connection]
<shrdlu68> xificurC: Fine, Godspeed.
<jmercouris> beach: Life can be a beach somtimes eh ;)?
<beach> Indeed.
<jackdaniel> sunny and sandy?
<beach> _death: Reading the logs, I see what you mean.
<makomo> LOL
dieggsy has joined #lisp
<beach> _death: Oh, this one is a pearl: "<kuribas> I am not expecting anything in common lisp to be new or surprising..."
fikka has joined #lisp
<beach> And this: "<kuribas> you give up a large part of safety when programming in a dynamic language", especially given that kuribas now wants arithmetic to be unsafe by default.
<_death> surprise tends to come when you least expect it
<kuribas> beach: we have a different view on what safety means.
<beach> Seems that way.
Inline has joined #lisp
<shrdlu68> "Infosec" safety vs correctness safety.
<beach> _death: It seems that way.
<jackdaniel> I think he means a compilation-time safety wrt types of function arguments. It can't be ignored as non-existent and CL indeed doesn't provide this kind of safety
<jackdaniel> but it is only a tiny piece of a big cake
<_death> I don't see how modular arithmetic is unsafe.. it's just something you need to implement because + and * on integers use ordinary kindergarten arithmetic
<shrdlu68> I thought using type declarations liberally gives you type safety.
sjl has quit [Quit: WeeChat 2.1]
<beach> _death: It is unsafe if your programs assume things like x + 1 > x.
Fare has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 264 seconds]
<_death> beach: I think by "unsafe" you mean "wrong"?
<beach> _death: Sure, I'll change my terminology if you like.
<jackdaniel> shrdlu68: type declarations give you nothing (they may be conformingly ignored), but you may do check-type. that gives you a runtime safety (you will be dropped in a debugger whne program runs and values of incorrect type are passed to the function)
smurfrobot has quit [Remote host closed the connection]
<beach> _death: And that is what so many programs in languages that use modular arithmetic seem to do, because I don't typically see any test for that situation each time I see an addition.
<jackdaniel> so this kind of problem in principle may be found *after* deployment
<beach> Yes, like in Ariane rockets and such.
sjl has joined #lisp
<jdz> In missiles in general I've heard -- their justification being that the missile hits the target sooner than values get close to overflow values.
<_death> beach: right.. but here the desideratum was modular arithmetic given ordinary arithmetic, not the other way around
jmercouris has quit [Ping timeout: 268 seconds]
<jackdaniel> I've read about a bug found on a racket (namely a memory leak which lead to OOM after some time). racket was after expensive process of QA and other verifications
Athas has joined #lisp
<jdz> I think that's the Ariane rocket beach mentioned.
<shrdlu68> jackdaniel: But your implemention can give guarantees, right? I mean, if an implementation does not ignore type declarations.
<jackdaniel> so they have figured out what is a maximum memory usage taking into account this memory leak while racket is running (say max 30m) and they've added enough memory to the hardware
<jdz> Right, might be something eles.
<jackdaniel> so they didn't have to change code which would require testing everything anwe
<jackdaniel> anew
<jdz> It seems we've heard the same story somewhere.
smurfrobot has joined #lisp
<jackdaniel> :)
<jdz> Exact details don't matter, of course.
<jackdaniel> shrdlu68: sure, that is possible, just as it is possible to have C compiler with some undefined behavior explicitly defined. either way, my point is that it gives you runtime safety, not compilation time, so it is somewhat weaker
<jackdaniel> I'm not saying that this kind of safety is crucial for good applications or that it improves overall quality
<White_Flame> kuribas: if your input numbers are declared or inferred to be, say, between 0 and 1000, then the output can be inferred to be between 0 and 3000, keeping it a fixnum
<jdz> OK, today I've learned that I've been relying on type checking behaviour that's very specific to SBCL. I guess I'll have to use SBCL exclusively from now on, because I like this behaviour.
<shrdlu68> I'm just used to SBCL holding my hand when I use type declarations.
<shrdlu68> jdz: "How I learned to stop worrying and embrace the implementation."
<White_Flame> kuribas: so don't fixate specifically on making things fixnums in particular
<jdz> Yeah, I've been keeping my code SBCL/CCL agnostic, but it is getting harder as time passes by.
<jdz> But I definitely remember CCL giving me errors when SBCL hasn't. Don't have a record of particular instances, though.
mindCrime has quit [Ping timeout: 265 seconds]
<jackdaniel> example are :type declarations for slots, CCL given high enough safety enforced it when you were using accessors. I think SBCL started doing that recently too
fikka has joined #lisp
EvW has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Folkol_ has joined #lisp
<jdz> Yeah, that seems to ring some bells.
dieggsy has quit [Remote host closed the connection]
<makomo> what is the meaning of the [[<something>]] syntax in CLHS' description of forms?
fikka has joined #lisp
<makomo> here "<something>" is some other rule within the same description
<beach> clhs 1.4.1.2.1
<specbot> Splicing in Modified BNF Syntax: http://www.lispworks.com/reference/HyperSpec/Body/01_daba.htm
<makomo> thanks!
<beach> Sure.
nicht has joined #lisp
nicht_ has joined #lisp
nickenchuggets has joined #lisp
<makomo> a question regarding CLOS style -- do people differentiate between using :default-initargs and :initform? the difference is subtle and i haven't seen :default-initargs used that often
<beach> The usage is different.
<beach> You typically use :default-initargs in a subclass to initialize slots in the superclass.
<beach> ... rather than repeating the slot and using :initform.
<makomo> oh, i haven't thought about superclasses, i see
fikka has quit [Ping timeout: 264 seconds]
omilu has quit [Ping timeout: 256 seconds]
<beach> That way, the subclass does not care how the initarg is used. It could be to initialize a slot, or it could be caught by initialize-instance.
<makomo> mhm, that's a very good point
andrei-n has quit [Quit: Leaving]
nydel has quit [Ping timeout: 255 seconds]
<makomo> and what about within just the class that's currently being defined?
<makomo> i.e. i'm defining a slot within some class for the first time and i have to choose between :default-initargs and :initform
copyeditor has quit [Ping timeout: 256 seconds]
<beach> I would use :initform there.
smurfrobot has quit [Remote host closed the connection]
<makomo> i've seen it discussed in the CLOS book even, but the difference was artificial and served mainly to communicate intent (but i don't know how well it does that)
fikka has joined #lisp
<makomo> the point about superclasses does make sense though
<beach> Yes, and let me expand on it...
<beach> It is often the case that you subclass a class from a library.
<beach> If the library is well written, it only documents initargs and accessors, not the existence or not of slots.
nydel has joined #lisp
<beach> So, you then use :default-initargs in your subclass, simply because it is your only option if you want to use only publicly documented features of the library.
<makomo> aha, since you have no knowledge of the superclass' slots and cannot duplicate the definition just to change the :initform
<beach> Exactly.
jmercouris has joined #lisp
<makomo> beach: thanks :-)
<beach> Anytime.
<beach> makomo: Your questions (and your reactions to my answers) make me think that you will make fast progress, so I don't mind answering them.
omilu has joined #lisp
copyeditor has joined #lisp
<beach> makomo: By the way, I can't remember whether I told you, the last Common Lisp HyperSpec reference about keyword arguments makes me think that an error should be signaled for you case.
Bronsa has quit [Read error: Connection reset by peer]
<makomo> beach: thanks for the encouragement, i appreciate it very much :-)
fikka has quit [Ping timeout: 276 seconds]
<makomo> beach: hmm i don't recall
<beach> The one about the accepted keyword arguments depending on the applicable methods.
<beach> clhs 7.6.5
<specbot> Keyword Arguments in Generic Functions and Methods: http://www.lispworks.com/reference/HyperSpec/Body/07_fe.htm
<makomo> oh i think i remember now
<makomo> right
<makomo> so i guess it's SBCL that's non-conforming in that case?
<beach> Until someone convinces me otherwise, that's what I think.
<Bike> what was the setup again? (defgeneric foo (&rest r)) (defmethod foo (&key c) ...) (foo :d ...)?
<makomo> yup
<specbot> Congruent Lambda-lists for all Methods of a Generic Function: http://www.lispworks.com/reference/HyperSpec/Body/07_fd.htm
<makomo> clhs 7.6.4
<makomo> and as we said, case 4 shouldn't apply in this case, since the GF doesn't have a &key in its lambda list
fikka has joined #lisp
felideon has joined #lisp
<Bike> Yeah I think that's a bad keyword.
<makomo> i haven't checked other implementations though, only SBCL
<makomo> welp, clisp does signal an error
smurfrobot has joined #lisp
davsebamse has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 260 seconds]
skapata has joined #lisp
FreeBirdLjj has joined #lisp
smurfrobot has quit [Ping timeout: 245 seconds]
pjb has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
davsebamse has joined #lisp
Trystam has joined #lisp
fikka has joined #lisp
Tristam has quit [Ping timeout: 256 seconds]
Trystam is now known as Tristam
smurfrobot has quit [Remote host closed the connection]
shrdlu68 has quit [Ping timeout: 260 seconds]
mindCrime has joined #lisp
fikka has quit [Ping timeout: 255 seconds]
robotoad has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
<xificurC> (let ((x '(1 2 3))) (check-type x ?)) to check if x is a list of numbers with unknown length
fikka has joined #lisp
<loke> xificurC: I'd use (assert (alexandria:sequence-of-length-p x 3))
<pjb> check-type does more than assert!
<loke> pjb: Agreed, but I never use those things :-)
<sjl> (defun list-of-numbers-p (list) (and (listp list) (every #'numberp list)))
<sjl> (check-type x '(satisfies list-of-numbers-p)
<loke> sjl: that's a good one
<pjb> xificurC: (defun list-of-number-p (x) (and (com.informatimago.common-lisp.cesarum.list:proper-list-p x) (every (function numberp) x)))
<pjb> sjl: listp = (or consp null) !!!
<makomo> pjb: what does it do? i just tried to use it like (check-type (name spec) symbol), where NAME is a reader function, and i'm getting warnings since CHECK-TYPE is expanding into (setf (name spec) ...)
<pjb> sjl: it doesn't test if the argument is a list.
<sjl> pjb: I am aware of this
<pjb> makomo: try it on a simple case: (let ((x 'foo)) (check-type x 'integer) x)
<sjl> pjb: are you saying NIL should not be considered a list of numbers?
<_death> makomo: the first argument should be a place
<pjb> sjl: no, I'm saying '(#C(42 -2) 3/4 . 42) is not a list of numbers.
<pjb> And neither is #1=( 1 2 . #1# )
<loke> You could also do
<sjl> pjb: the second one absolutely is a list of numbers, it's just infinite
<makomo> _death: oh hmm right
<pjb> when you say list, you usually mean proper-list.
smurfrobot has joined #lisp
<makomo> _death: which means that it must be SETF-able?
<loke> (check-type x (cons number (cons number (cons number null))))
fikka has quit [Ping timeout: 240 seconds]
<_death> makomo: yes.. check-type sets up restarts that may modify place to have a value of the proper type
<pjb> xificurC: also notice that (every 'numberp '( 2/3 5.5 #c(1 2) )) #| --> t |#
<makomo> _death: ahh, right, didn't think of that
<sjl> sure, use (alexandria:proper-list-p list) instead of listp if you want to enforce proper lists
<pjb> Sometimes you want to implement your own I/O loop validating the type of the inputs (notably if you have to do some parsing or conversions), but in simplier cases, check-type is a great operator!
<sjl> ctypecase is similarly handy
smurfrobot has quit [Ping timeout: 264 seconds]
housel has quit [Read error: Connection reset by peer]
housel has joined #lisp
EvW has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
dieggsy has joined #lisp
mrcom has quit [Read error: Connection reset by peer]
mrcom has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
robotoad has quit [Quit: robotoad]
robotoad has joined #lisp
mingus` has joined #lisp
fikka has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
mingus has quit [Ping timeout: 240 seconds]
robotoad has quit [Read error: Connection reset by peer]
robotoad_ has joined #lisp
scymtym_ has quit [Ping timeout: 245 seconds]
fikka has quit [Ping timeout: 256 seconds]
schweers has quit [Ping timeout: 276 seconds]
robotoad_ has quit [Quit: robotoad_]
orivej has joined #lisp
mingus`` has joined #lisp
fikka has joined #lisp
mingus` has quit [Ping timeout: 255 seconds]
orivej has quit [Ping timeout: 265 seconds]
<Xach> I haven't tried ctypecase at all!
<Xach> I like cerror and try to use it when I can. I didn't really think about it for a long time.
fikka has quit [Ping timeout: 265 seconds]
gabiruh has quit [Ping timeout: 260 seconds]
scymtym has joined #lisp
rippa has joined #lisp
FreeBirdLjj has joined #lisp
robotoad has joined #lisp
fikka has joined #lisp
nickenchuggets has quit [Read error: Connection reset by peer]
nickenchuggets has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
jeosol has joined #lisp
<jeosol> morning guys
fikka has joined #lisp
<beach> Hello jeosol.
smurfrobot has joined #lisp
wigust has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
<jeosol> Hi beach.
<jeosol> I want to thank you and all the other guys who responded and helped with query regarding the Optimization Challenge I was participating in. I recently received notice (recently) that my initial results where accepted and I should send additional info
<jeosol> this was a late notice because it was sent last month, and due to some mailing issue, i could respond.
jmercouris has quit [Ping timeout: 264 seconds]
<jeosol> I'll need to get some AWS machines to run rest of the cases. Currently research how to replicate an initial EC2 because manual install is a pain. Not a cloud expert.
<beach> Congratulations! Though I don't think I was of any direct help. At least, I can't find any trace in the logs that I was.
fikka has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Remote host closed the connection]
<jeosol> Really. I can't remember all the names of my head. aeth, jackdaniels, Bike, ...
<Bike> i sorta remember. you're welcome
<jeosol> it was a lot of questions over several weeks, so I can't remember all the names
<jeosol> I was getting the system to work in a stable fashion then, working with many threads, etc.
<jeosol> I did actually get a lot of help initially with the folks at comp.lang.lisp before I got here, but that site got very toxic so I stopped going there, but still read the questions occasionally
<kuribas> So I found out I can get similar performance as in haskell by using (unsigned-byte 56) instead of fixnum.
fikka has joined #lisp
<kuribas> might have been nice if that was suggested instead of a lecture on safety...
vaporatorius has quit [Ping timeout: 240 seconds]
<beach> It was suggested. Not by me, though.
<kuribas> safety didn't seem to make a real difference.
mflem has joined #lisp
<jeosol> jackdaniel: I am sending you a bottle of your name.
fikka has quit [Ping timeout: 240 seconds]
<jackdaniel> jeosol: cool :-)
<jackdaniel> is there a reason for that? also – where did you find my address? unless it is a virtual bottle…
varjag has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
hhdave has quit [Ping timeout: 265 seconds]
_cosmonaut_ has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
Folkol_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gabiruh has joined #lisp
fikka has quit [Ping timeout: 265 seconds]
m00natic has quit [Remote host closed the connection]
imjacobclark has quit [Ping timeout: 260 seconds]
lumm_ has joined #lisp
nicht has quit [Quit: Leaving]
fikka has joined #lisp
lumm has quit [Ping timeout: 245 seconds]
lumm_ is now known as lumm
pierpal has quit [Ping timeout: 240 seconds]
Quetzal2 has joined #lisp
rumbler31 has joined #lisp
ultimate_beginne has joined #lisp
<ultimate_beginne> Hello beach, aeth, white_flame!
<ultimate_beginne> And all
dieggsy has quit [Remote host closed the connection]
dyelar has quit [Remote host closed the connection]
rumbler31 has quit [Ping timeout: 268 seconds]
<ultimate_beginne> Would it be fair to say that C FFI is a lisp DSL for writing low-level operations? Woke up pondering the question.
<p_l> ultimate_beginne: depends on the actual implementation, but no
lumm_ has joined #lisp
<p_l> LAP would be the DSL
housel has quit [Remote host closed the connection]
lumm has quit [Ping timeout: 264 seconds]
lumm_ is now known as lumm
sendai_ has quit [Ping timeout: 260 seconds]
<ultimate_beginne> I guess I'm thinking along the lines of (defmacro low-level (...) (...dsl similar to loop macro but with keywords for pointers, volatile, restrict, etc...))
azimut has joined #lisp
<ultimate_beginne> Essentially a compiler.. I suppose.
whartung_ has joined #lisp
whartung has quit [Read error: Connection reset by peer]
whartung_ is now known as whartung
dieggsy has joined #lisp
<White_Flame> FFI gives you data access to low-level memory, and the ability to call low-level code. It doesn't let you write low-level operations directly
<White_Flame> in terms of code
<White_Flame> however, the native code Lisp compilers are written in Lisp, and can be extended
<ultimate_beginne> I see
sjl has quit [Ping timeout: 256 seconds]
sjl has joined #lisp
varjag has joined #lisp
shka_ has joined #lisp
MichaelRaskin has joined #lisp
devon has joined #lisp
pierpal has joined #lisp
nowhere_man has joined #lisp
nicht_ has quit [Ping timeout: 245 seconds]
pierpal has quit [Quit: Poof]
<jeosol> jackdaniel: Yes, virtual bottle, don't have your address
pierpal has joined #lisp
karlosz has quit [Read error: Connection reset by peer]
karlosz has joined #lisp
arubin has joined #lisp
dieggsy has quit [Remote host closed the connection]
wheelsucker has joined #lisp
comborico1611 has joined #lisp
jeosol has quit [Quit: Page closed]
dminuoso has joined #lisp
ultimate_beginne has quit []
nicht_ has joined #lisp
nicht_ has quit [Max SendQ exceeded]
dieggsy has joined #lisp
smurfrobot has joined #lisp
devon has quit [Ping timeout: 240 seconds]
shrdlu68 has joined #lisp
surya has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Ping timeout: 256 seconds]
nowhere_man has joined #lisp
<jackdaniel> oh, I'm disappointed now
<jackdaniel> you've put my hopes high
brendyn has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
sauvin has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 245 seconds]
FreeBirdLjj has joined #lisp
devon has joined #lisp
FreeBirdLjj has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
dieggsy has quit [Ping timeout: 245 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
jmsb has joined #lisp
fikka has joined #lisp
zachk has joined #lisp
zachk has joined #lisp
zachk has quit [Changing host]
Lauven has joined #lisp
DemolitionMan has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
vaporatorius has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vap1 has joined #lisp
raynold has joined #lisp
devon has quit [Ping timeout: 256 seconds]
arubin has quit []
kuribas has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
fikka has joined #lisp
Mutex7 has joined #lisp
jeosol has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
puchacz has joined #lisp
fikka has joined #lisp
Guest31678 has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 256 seconds]
<knobo> jackdaniel: does ecl garbage collect functions that is defined with a gensym as name?
EvW has joined #lisp
<knobo> jackdaniel: like this: (defmacro def () (let ((n (gensym))) `(defun ,n () (format nil "t"))))
vap1 has quit [Quit: Leaving]
fikka has joined #lisp
devon has joined #lisp
<jackdaniel> knobo: I think it doesn't, but I don't know it as a fact
shrdlu68 has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 240 seconds]
smasta has joined #lisp
fikka has joined #lisp
warweasle has quit [Quit: later]
lumm has quit [Quit: lumm]
lumm has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Smokitch has quit []
makomo has quit [Read error: Connection reset by peer]
fikka has joined #lisp
igemnace has joined #lisp
Canaimero-15d has joined #lisp
Canaimero-15d has quit [Read error: Connection reset by peer]
fikka has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
EvW has quit [Ping timeout: 245 seconds]
fikka has quit [Ping timeout: 256 seconds]
EvW1 has joined #lisp
igemnace has quit [Remote host closed the connection]
fikka has joined #lisp
puchacz has quit [Quit: Konversation terminated!]
ebrasca has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Quetzal2 has quit [Quit: ?? Bye!]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
fikka has quit [Ping timeout: 248 seconds]
Cymew has quit [Remote host closed the connection]
Cymew has joined #lisp
jeosol has quit [Quit: Page closed]
scymtym has quit [Ping timeout: 265 seconds]
Cymew has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
terpri has quit [Ping timeout: 264 seconds]
eli_oat has quit [Quit: Leaving.]
fikka has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
attila_lendvai has quit [Quit: Leaving.]
comborico1611 has quit [Quit: Konversation terminated!]
fikka has joined #lisp
orivej has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
Arcaelyx has quit [Quit: Textual IRC Client: www.textualapp.com]
scymtym has joined #lisp
shka_ has quit [Ping timeout: 240 seconds]
libre-man has quit [Read error: Connection reset by peer]
msb has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
msb has joined #lisp
lumm has quit [Quit: lumm]
dmiles has quit [Ping timeout: 264 seconds]
mindCrime has quit [Ping timeout: 255 seconds]
subroot has joined #lisp
subr has joined #lisp
fraya has quit [Remote host closed the connection]
subr has quit [Remote host closed the connection]
dmiles has joined #lisp
Lauven has quit [Ping timeout: 240 seconds]
libre-man has joined #lisp
smasta has quit [Quit: WeeChat 2.1]
smasta has joined #lisp
vlatkoB_ has quit [Remote host closed the connection]
Bike has quit [Ping timeout: 260 seconds]
EvW1 has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 245 seconds]
devon has quit [Ping timeout: 265 seconds]
fisxoj has joined #lisp
Arcaelyx has joined #lisp
whartung has quit [Quit: whartung]
Mutex7 has quit [Quit: Leaving]
mareskeg has quit [Ping timeout: 264 seconds]
milanj has quit [Quit: This computer has gone to sleep]
TCZ has joined #lisp
Bike has joined #lisp
vhost- has quit [Ping timeout: 256 seconds]
TCZ has quit [Quit: Leaving]
whartung has joined #lisp
gabiruh has quit [Ping timeout: 240 seconds]
schoppenhauer has quit [Ping timeout: 265 seconds]
schoppenhauer has joined #lisp
fikka has quit [Ping timeout: 265 seconds]
dented42 has joined #lisp
Jesin has quit [Quit: Leaving]
Jesin has joined #lisp
fikka has joined #lisp
varjag has quit [Ping timeout: 240 seconds]
terpri has joined #lisp
varjag has joined #lisp
pierpal has quit [Quit: Poof]
orivej has joined #lisp
pierpal has joined #lisp
varjag has quit [Ping timeout: 276 seconds]
random-nick has quit [Read error: Connection reset by peer]
sjl has quit [Quit: WeeChat 2.2-dev]
k-hos has quit [Read error: Connection reset by peer]
k-hos has joined #lisp
gabiruh has joined #lisp
robotoad has quit [Quit: robotoad]
fikka has quit [Ping timeout: 255 seconds]
gabiruh has quit [Ping timeout: 240 seconds]
pierpa has joined #lisp
robotoad has joined #lisp
Kaisyu has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 265 seconds]
BitPuffin has quit [Remote host closed the connection]
<Ukari> is defmacro has different with eval in efficiency?
subroot has quit [Read error: Connection reset by peer]
<Ukari> for example, (defmacro excute (&body expr) `(progn ,@expr)) (excute (print "foo") (print "bar")) and (eval (list 'progn (list 'print "foo") (list 'print "bar")))
fikka has joined #lisp
<Bike> you're comparing apples and oranges
fikka has quit [Ping timeout: 248 seconds]
gabiruh has joined #lisp
Pixel_Outlaw has joined #lisp
mareskeg has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
estest has joined #lisp
fikka has joined #lisp
jack_rabbit has joined #lisp
<White_Flame> defmacro will give your expr to be compiled at compiled time, and run at runtime
<White_Flame> eval will compile and run at runtime (for implementations which auto-compile)
<White_Flame> plus, since macros return source code that art part of a compilation unit, they're better tied to their surroundings than a standalone eval
<White_Flame> *are
<White_Flame> especially since macros can be inside lexical scopes