corpix has quit [Remote host closed the connection]
corpix has joined #lisp
loli has joined #lisp
<anlsh>
MichaelRaskin: blame-shifting wouldn't fix anyone's code, but it would provide an incentive to use better coding style (again, with newer packages) and make it easier to add functionality to libraries right?
terpri has joined #lisp
<MichaelRaskin>
You say adding functionality to the existing libraries instead of new namespaces like it's a good thing
<MichaelRaskin>
And pure blameshifting provides no incentive
MerlinTheWizard has joined #lisp
<MichaelRaskin>
I guess if you indeed export a NIL distinct from CL:NIL people are more likely to reconsider whether they want to :use such a library
buffergn0me has joined #lisp
tburdick has joined #lisp
schjetne has quit [Ping timeout: 246 seconds]
<anlsh>
Well it's not exactly a *bad* thing, is it? For example, a while back I re-implemented alexandria's median function as a special case of the quick-select algorithm. I suggested that they might as well provide the quick-select function too, but the exporting issue got in the way
rixard has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
rixard has quit [Ping timeout: 260 seconds]
pilne has joined #lisp
efm has quit [Quit: Konversation terminated!]
zaquest has quit [Quit: Leaving]
akoana has quit [Ping timeout: 260 seconds]
akoana has joined #lisp
Jeanne-Kamikaze has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
<MichaelRaskin>
Well, the idea of alexandria-2 that would include entire alexandria and then some more also makes sense
tburdick has quit [Ping timeout: 265 seconds]
zaquest has joined #lisp
MerlinTheWizard has quit [Ping timeout: 240 seconds]
buffergn0me has quit [Ping timeout: 240 seconds]
MerlinTheWizard has joined #lisp
cwaydt has quit [Ping timeout: 265 seconds]
patlv has quit [Quit: patlv]
bitmapper has quit [Ping timeout: 265 seconds]
MerlinTheWizard has quit [Remote host closed the connection]
emys has joined #lisp
MerlinTheWizard has joined #lisp
buffergn0me has joined #lisp
shukryzablah has joined #lisp
holycow has quit [Quit: leaving]
ahungry has joined #lisp
emys has quit [Ping timeout: 265 seconds]
Zakkor has quit [Quit: Connection closed for inactivity]
phoe has quit [Ping timeout: 272 seconds]
phoe has joined #lisp
emys has joined #lisp
dmiles has quit [Read error: No route to host]
dmiles has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
EvW has quit [Ping timeout: 240 seconds]
lxbarbosa has quit [Remote host closed the connection]
emys has quit [Ping timeout: 246 seconds]
emys has joined #lisp
Josh_2 has quit [Ping timeout: 260 seconds]
MerlinTheWizard has quit [Ping timeout: 244 seconds]
emys has quit [Ping timeout: 240 seconds]
terpri has quit [Remote host closed the connection]
emys has joined #lisp
schjetne has joined #lisp
MerlinTheWizard has joined #lisp
Demosthenex has quit [Ping timeout: 250 seconds]
Demosthenex has joined #lisp
mono has joined #lisp
ahungry has quit [Ping timeout: 244 seconds]
monokrom has quit [Ping timeout: 260 seconds]
emys has quit [Ping timeout: 240 seconds]
emys has joined #lisp
tburdick has joined #lisp
emys has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 240 seconds]
schjetne has quit [Ping timeout: 260 seconds]
emys has joined #lisp
karlosz has quit [Quit: karlosz]
anlsh has quit [Ping timeout: 240 seconds]
turona has quit [Ping timeout: 265 seconds]
turona has joined #lisp
<White_Flame>
hmm, I have a relatively control-flow-twisted question to try to ask, as it's a bit difficult to make a simple test case for
<White_Flame>
will RETURN-FROM always return to the exact point in the call stack that its lexical block was established, even if there were intermediary blocks of the same name?
<White_Flame>
assumign that in do-cps-style, there are other recursive uses of block foo
<White_Flame>
from the same source code
karlosz has joined #lisp
<White_Flame>
so, on the call stack, there are multiple places where this same code was called, establishing block foo's. The return-from will return to the exact stack frame it was established in, and not just the first found?
<Bike>
White_Flame: yes, it will return to the particular frame.
<White_Flame>
thank you veeeeery much
<Bike>
it's kind of a tricky point.
<saturn2>
block/return-from does the thing you want, and catch/throw does the thing you don't want
<White_Flame>
ah, k
<White_Flame>
I had tried catch/throw first, but it seemed less right
<White_Flame>
(without executing yet, the code I"m refactoring is quite large)
<White_Flame>
thanks
emys has quit [Ping timeout: 260 seconds]
emys has joined #lisp
terpri has joined #lisp
dtman34 has quit [Ping timeout: 240 seconds]
tburdick has quit [Ping timeout: 265 seconds]
akoana has left #lisp ["Leaving"]
<karlosz>
publickey denied
emys has quit [Ping timeout: 246 seconds]
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
Bike has quit [Quit: Lost terminal]
pilne has quit [Quit: Hard work pays off in the future, laziness pays off now]
terpri has quit [Remote host closed the connection]
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 244 seconds]
terpri has joined #lisp
emys has joined #lisp
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
libertyprime has joined #lisp
SGASAU has quit [Remote host closed the connection]
SGASAU has joined #lisp
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
emys has quit [Ping timeout: 260 seconds]
wsinatra has joined #lisp
EvW1 has joined #lisp
wsinatra has quit [Client Quit]
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
<beach>
Good morning everyone!
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
libertyprime has quit [Ping timeout: 260 seconds]
terpri has quit [Remote host closed the connection]
libertyprime has joined #lisp
emys has joined #lisp
vhost- has quit [Quit: WeeChat 2.6]
emys has quit [Ping timeout: 244 seconds]
libertyprime has quit [Ping timeout: 260 seconds]
Jeanne-Kamikaze has quit [Remote host closed the connection]
emys has joined #lisp
shka_ has joined #lisp
emys has quit [Ping timeout: 265 seconds]
mixfix41 has quit [Read error: Connection reset by peer]
Bourne has quit [Remote host closed the connection]
emys has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
schjetne has joined #lisp
torbo has quit [Remote host closed the connection]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
dancynancy has joined #lisp
Kundry_Wag has quit [Read error: Connection reset by peer]
<rtvdenys>
(asdf:compile-system :cl-async :verbose t :force t) made it error and the error is quite unclear. I suspect it did not like those asdf options
<phoe>
post the error!
<phoe>
also, post (asdf:asdf-version)
<phoe>
and please use a pastebin
<rtvdenys>
"3.3.1"
<phoe>
OK, recent enough
<rtvdenys>
debugger invoked on a UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread
<phoe>
doomlist3: #clschool plus some programming books might benefit you more
<phoe>
rtvdenys: I have no idea why you get these warnings; cl-async is supposed to compile cleanly if it is on quicklisp
<beach>
doomlist3: This is elementary stuff. You need to grab a book and read it.
<phoe>
let me try to reproduce...
<White_Flame>
minion: tell doomlist3 about pcl
<minion>
doomlist3: please look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
<doomlist3>
minion: i was reading exactly that!
<minion>
well, i've never been reading exactly that
<no-defun-allowed>
I can load it with (ql:quickload :cl-async)
<Cymew>
doomlist3: Learn to use an editor that helps you balance the parens, and it will be much easier.
<Cymew>
doomlist3: I don't remember if Peter talks about that, but there are options.
<phoe>
rtvdenys: can't reproduce, it compiles cleanly on my machine. What's your repository version and which commit is your repository at?
<beach>
doomlist3: Then you will know that (<something> <something-else>) means that <something> is an operator that is applied to <something-else> as an argument.
<Cymew>
doomlist3: emacs and slime is probably most commonly used on linux.
<beach>
doomlist3: And a number is not a valid operator.
<phoe>
rtvdenys: what does (asdf:system-relative-pathname :cl-async "") give you?
<rtvdenys>
oh... looks like my SBCL may be old
<rtvdenys>
SBCL 1.5.5.debian
<phoe>
rtvdenys: that's not exactly the newest, yep
<rtvdenys>
That's what is packaged in Ubuntu 19.10. :(
<phoe>
rtvdenys: just to be sure, please give me (asdf:system-relative-pathname :cl-async "")
<rtvdenys>
#P"/home/rtvd/src/ALIEN/cl-async/"
<doomlist3>
okay and i did (defun hello-world () (list 'bull' 3 "shit")) why is bull an atom and "shit" a string
<rtvdenys>
So I should try to get a fresh SBCL and see what happens. Maybe that will sort it out.
<beach>
doomlist3: Strings are atoms.
<beach>
doomlist3: This is really elementary stuff.
<White_Flame>
quote is a unary operator. It is not a string delimeter pair like doublequote
<doomlist3>
are double and single quotes the same
<White_Flame>
so you really have (list 'bull '3 ...
<White_Flame>
no, read the book
<White_Flame>
you should at least be able to get the basic syntax rules from reference
<White_Flame>
as opposed to just random questions filling in only bits of your understanding
<doomlist3>
by reference you mean gigamonkeys.com?
<doomlist3>
i am reading that book
<White_Flame>
yes, I believe it covers all that
<_death>
'bull = (quote bull)
<phoe>
rtvdenys: that's good, the pathname to the system seems to be correct.
karlosz has quit [Quit: karlosz]
emys has joined #lisp
z147 has joined #lisp
karlosz has joined #lisp
<phoe>
let me know what happens after the SBCL update
karlosz has quit [Remote host closed the connection]
specbot has quit [Ping timeout: 256 seconds]
mgr_ has quit [Ping timeout: 256 seconds]
corpix_ has joined #lisp
jello_pudding has joined #lisp
corpix has quit [Ping timeout: 240 seconds]
gxt has quit [Ping timeout: 240 seconds]
emys has quit [Ping timeout: 265 seconds]
specbot has joined #lisp
gxt has joined #lisp
mgr_ has joined #lisp
Oddity has quit [Ping timeout: 260 seconds]
emys has joined #lisp
Krystof has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
<rtvdenys>
I've built sbcl 2.0.4 from source and it compiles differently but it still fails. Perhaps I should remove all .fasl files as they were compiled by the previous version?
Oddity has joined #lisp
<phoe>
that won't really help, FASLs are already invalidated between SBCL versions
<rtvdenys>
It seems to be failing on static-vectors.asd at the moment.
<phoe>
which version of static-vectors do you have downloaded?
<phoe>
also, once again, why aren't you using quicklisp?
<rtvdenys>
1.8.4
<rtvdenys>
I think I may have got this one from quicklisp but I am not sure.
<phoe>
you should be able to `cd ~/quicklisp/local-projects && git clone cl-async` and then just (ql:quickload :cl-async)
<phoe>
I mean, your issues are foreign to me, but then also you have a setup that doesn't resemble mine
narimiran has quit [Ping timeout: 260 seconds]
<phoe>
I clone only the projects I edit or whose changes are not yet upstreamed to Quicklisp; the rest, QL pulls for me, including all the dependencies
Kundry_Wag has joined #lisp
<rtvdenys>
(quicklisp:quickload :cl-async) works fine. But then it may be hiding some warnings, may it not?
<phoe>
rtvdenys: no, it still uses ASDF under the hood
<phoe>
...but wait a second
<_death>
(setf ql:*quicklisp-verbose* t) in your rc file
<Xach>
axion: ifd-alist is called on an ifd, not an exif...
<axion>
[Function]
<axion>
exif-alist exif &key parsedp => alist
<axion>
oops :)
<axion>
or rather
<axion>
[Function]
<axion>
ifd-alist exif &key parsedp => alist
<axion>
reading the docs :)
<Xach>
that is definitely a doc bug. it's meant to take one of the ifds in the exif, not the exif.
<Xach>
like image-ifd, exif-ifd, gps-ifd
<axion>
I see, thanks
Cymew has quit [Ping timeout: 246 seconds]
emys has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
<axion>
Xach: I get the same alist with (exif-alist exif :parsedp t) that i do with (ifd-alist (image-ifd exif) :parsedp t). Is that correct? I'm not very familiar with this format
<Xach>
axion: I don't remember, sorry.
<axion>
Ok
<Xach>
I *think* it might help to know the exif standard well before using zpb-exif, but I'm not sure.
<Xach>
I honestly can't remember why I wrote it. possibly for some graphics website or something.
emys has joined #lisp
<axion>
Well regardless, it works and it's better than the only other parser, so thanks! pngload will soon have exif support
<Xach>
sweet
<axion>
I think 3b is going to send you a PR for reading from an octet vector (simple change, additional non-breaking API function)
dale_ has joined #lisp
dale_ is now known as dale
davd has joined #lisp
<Xach>
doc fix would be welcome too!
CrazyEddy has quit [Ping timeout: 260 seconds]
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
<|3b|>
yeah, will send a PR for the exit octet-vector stuff after testing it a bit more.
rgherdt_ has quit [Remote host closed the connection]
<|3b|>
i think exif-alist includes image-ifd and a few other common IFDs, but not all of them, so you need ifd-alist for the rest
stoneglass has joined #lisp
Bourne has joined #lisp
MerlinTheWizard has joined #lisp
Lycurgus has joined #lisp
flip214 has quit [Ping timeout: 258 seconds]
flip214 has joined #lisp
<MerlinTheWizard>
In PCL Chapter 20 - The Special Operators, under "Unwinding the Stack", Peter Seibel talks about 'closures' and uses the phrase 'closed over' to mean something that to me doesn't sound any different from 'referenced':
<MerlinTheWizard>
What is the difference in that context between a 'closure' and a 'reference'? Can anyone tell me?
<|3b|>
if you have a variable binding (let ((x 1)) ...) the binding normally no longer exists after that LET form exits
<|3b|>
if it is (let ((x 1)) (lambda () x)), the function returned from the let continues to use that binding, so it continues to exist, and that is called a closure, and x is "closed over"
<Xach>
a closure is a function object. the references to enclosing lexical bindings distinguish a mundane function object from a closure.
<Bike>
it's a bit more complicated since in this context, rather than closing over a binding, it's closing over an exit point, which does actually cease being valid once the block exits
<|3b|>
in particular, if you have (let ((x 1)) (lambda () x) (lambda () (incf x))), both function continue to access the /same/ binding of X, so calling the 2nd will change the value returned by the first
<MerlinTheWizard>
|3b|, I very roughly understand that explanation of closure, but it doesn't seem to apply here in this context.
<|3b|>
ah, same thing applies to block names and tags, though you can't access those after it exits
<MerlinTheWizard>
It looks just like a normal reference to me.
<MerlinTheWizard>
Can you explain why?
<|3b|>
hmm, to some extent there might not be much difference in that case, since it is limited to the scope of the outer form
<MerlinTheWizard>
I mean in this context, BLOCK a just exists for its normal lexical scope. There's no modification of the scope of a reference. So how is it a closure?
<|3b|>
though it still has to maintain a reference to the containing environment in the function object
gko has quit [Ping timeout: 246 seconds]
<Bike>
because it refers to the same block even if called in a context in which there's another block with the same name
<MerlinTheWizard>
3b, like any ordinary lexical symbol, as far as I know.
<Bike>
well, yes, it's like any ordinary lexical variable in that respect
<Bike>
lexical variables are also closed over
<|3b|>
(lambda (x) x) contains its own environment, and doesn't reference anything outside that function
<|3b|>
(let ((x 1)) (lambda () x)) has to keep a ref to the containing environment
<Bike>
if you have (block nil (let ((f (lambda () (return-from nil)))) (block nil (funcall f)) (print "H")))), no H is printed
<|3b|>
block works the same way
<Bike>
since the function knows where it's supposed to return to - it's "closed over" that information
<|3b|>
yeah, that :)
<Bike>
if you do this with catch/throw (the operators explained a bit farther on in the text), nothing is closed over and H is printed
<MerlinTheWizard>
Bike, I need someone to draw me a picture or something. This concept is hard enough to grasp on it's own, but when the term 'closure' is used when 'reference' would do, it makes understanding this idea even harder.
<MerlinTheWizard>
Bike, Catch and throw, don't these usually kind of break the lexical environment?
<phoe>
MerlinTheWizard: what does "reference" mean in your internal language?
<TMA>
MerlinTheWizard: basically, there are two kinds of reference.
<Bike>
i don't know what you mean by "break the lexical environment".
<phoe>
MerlinTheWizard: lisp CATCH and THROW are dynamic, not lexical
<TMA>
MerlinTheWizard: a lexical and a dynamic
<phoe>
they are like BLOCK and RETURN-FROM except they work dynamically and can therefore be e.g. in separate functions
<MerlinTheWizard>
phoe, yes, that's kind of what I mean.
<MerlinTheWizard>
I guess 'break' might be a harsh word there.
Aurora_v_kosmose has quit [Quit: Пока, мир.]
<phoe>
BLOCK and RETURN-FROM work lexically
<MerlinTheWizard>
phoe, 'reference' is quite a broad term, a very fundamental term within semantics, and therefore hard to define.
Aurora_v_kosmose has joined #lisp
<Bike>
and closure and reference mean different things. casually, i might say that a "closure" "closes over" a variable so that the correct one can be "referenced" when the function is called
<MerlinTheWizard>
Usually when a refers to b, a can stand in for b.
<Bike>
lisp has lots of side effects, so referential transparency like that isn't quite enough
<MerlinTheWizard>
Bike, in this case the semantics of the supposed 'closure' seems to refer to something that happens in any ordinary function return.
<Grue`>
what is the context where the word 'closure' can be replaced by 'reference'? seems like refer to completely different things
<MerlinTheWizard>
It seems like the 'BLOCK' could just be replaced by a function.
<Bike>
you say "ordinary" but this is like, not something that's possible in many languages.
<phoe>
MerlinTheWizard: which sort of function?
<MerlinTheWizard>
In PCL Chapter 20 - The Special Operators, under "Unwinding the Stack", Peter Seibel talks about 'closures' and uses the phrase 'closed over' to mean something that to me doesn't sound any different from 'referenced':
<Bike>
the point is that when bar is called, it calls that lambda, which immediately returns from (block a...), so the "Leaving BLOCK" is never executed.
<MerlinTheWizard>
TMA, yes. dynamic is sort of global - sort of.
<Shinmera>
Wha
<Bike>
you could like, rewrite this in continuation passing style or something and then it could be all pure functions. maybe that's what you mean?
<TMA>
MerlinTheWizard: if so then 'close over x' means 'keep reference to the lexical binding currently in effect' and closure is the result of that process
<MerlinTheWizard>
Bike, that's what happens with typical early 'return', which can happen in a pure function.
<TMA>
MerlinTheWizard: so closure is not something that is a reference, but something that keeps the reference inside itself intact
<Bike>
MerlinTheWizard: let's back up a moment. you say "typical". what is your reference frame for "typical"? are you thinking of some other programming language or what?
<Grue`>
A is "closed over" B is more like B is "referenced" by A. So it's kind of the opposite?
<MerlinTheWizard>
Bike, yeah, languages like 'C' and 'Bash' behave this way.
<phoe>
MerlinTheWizard: in Lisp you don't have to early-return from a pure function
<phoe>
you don't even have to return from a function
<Bike>
C does not have closures at all, so the example in the book is not possible.
<Bike>
I mean, there's nothing analogous to LAMBDA, right?
<phoe>
(if foo-p (block nil ...) (block another-nil ...)) is perfectly fine
<MerlinTheWizard>
phoe, there is an implicit return in lisp.
<Bike>
You can pass function pointers around, but when a "return" statement is executed, it returns only from the function the statement is in.
<MerlinTheWizard>
Bike, is the lambda in bar?
<Bike>
Again, I'm talking about the first example in the section you linked. Consider (bar #'(lambda () (return-from a))). How would you write that in C?
<phoe>
in the PCL example, an anonymous function is passed to bar as an argument
<MerlinTheWizard>
It looks like it's kind of tacked on to bar.
kopiyka has joined #lisp
<phoe>
it's not really tacked on, it's a separate function
<Bike>
BAR is just a function. (bar #'(lambda () (return-from a))) is a function call with one argument.
toorevitimirp has joined #lisp
<phoe>
this is equivalent to (let ((fn (lambda () (return-from a)))) (bar fn))
<MerlinTheWizard>
Oh, bar takes a function argument, that's right.
<Bike>
right.
<MerlinTheWizard>
So the lambda makes bar close over the BLOCK?
<Bike>
yes.
<Bike>
this function's body is (return-from a). It returns from the (block a...), which is outside the function itself.
<Bike>
This is not something you can do in C (I mean there's longjmp, but it sucks)
<MerlinTheWizard>
Ok, so block captures the reference. I believe I'm sort of getting it now.
<phoe>
the block doesn't capture anything, it just stands there
<phoe>
it is the function that now "remembers" where it needs to return to
<Bike>
the block kind of is the thing being captured.
<MerlinTheWizard>
phoe, I got that. BLOCK is the object referred to.
<phoe>
yes
<phoe>
in Lisp, and not only, that is called "closing over" some things
<phoe>
a function can close over a block and then that function can go into other places
<MerlinTheWizard>
So, in a closure, a referenced symbol is always made available outside of it's normal scope?
copec has quit [Ping timeout: 240 seconds]
schjetne has quit [Ping timeout: 244 seconds]
<phoe>
it's not really a symbol that is being made available
JuxTApoze has joined #lisp
<Bike>
It's still in scope.
<JuxTApoze>
o/ all
<phoe>
it is the block, in this case
<phoe>
JuxTApoze: helloooo
<MerlinTheWizard>
Right, so bar is running within that scope. I guess that's what threw me.
<MerlinTheWizard>
So why is it a closure then, if it's still in the same scope?
<MerlinTheWizard>
Because bar doesn't normally have that block as a thing to return from?
<Bike>
Why is the (lambda () (return-from a)) a closure?
<MerlinTheWizard>
Yeah.
<phoe>
because it refers to a block named by symbol A, even though that block is outside the body of that function
<Bike>
I gave an example a while ago. The closure has to "know" where it's returning from. For example, if the body of the BAR function had another (block a ...), that would have no relevance on where the closure would return from.
<MerlinTheWizard>
So bar's own lexical binding of 'block a' is shadowed, and that makes it a closure?
<Bike>
It's not that it's shadowed, it's just not relevant.
<Bike>
What makes (lambda () (return-from a)) a closure is that it refers to a kind of lexical binding outside the function body, so it has to carry information about that binding around.
<Bike>
a kind of lexical binding FROM outside*
<Bike>
is this not explained earlier in the book for variables?
ayuce has joined #lisp
<MerlinTheWizard>
Bike, he might have briefly mentioned closures earlier, but I guess I didn't get it.
<Bike>
they're explained in chapter 6, "Variables", it seems
<Bike>
in the "Lexical Variables and Closures" section
<MerlinTheWizard>
Bike, I've read explanations of closures before. They were always confusing to me.
<MerlinTheWizard>
If they always referred to capture of a symbol outside of it's lexical scope, I guess it would make sense to me.
<MerlinTheWizard>
But in this case, the lexical scope is preserved from the perspective of the instance (although not from the definition of bar)
<Bike>
There's the example of (let ((count 0)) #'(lambda () (setf count (1+ count)))) in the Variables chapter. The point is that the function "closes over" the binding of COUNT, so if you call the function repeatedly it updates that same binding.
<Bike>
as it says, you can do (defparameter *fn* (let ((count 0)) #'(lambda () (setf count (1+ count))))), and then (funcall *fn*) => 1, (funcall *fn*) => 2, ...
<MerlinTheWizard>
Cymew, that looks good, thanks.
<Bike>
i would try to understand it with variables before going on to block/return-from, personally
<phoe>
yes, I'd go with the classical getter/setter example first
<phoe>
there, a closure is just a poor man's object
<MerlinTheWizard>
phoe, everything is an object in CL, so that's kind of a bad wording.
<Bike>
oh shit gottem
fourier has joined #lisp
<Xach>
i like to think of a closure as a function that carries around (some of) its defining lexical environment
<phoe>
MerlinTheWizard: an object in the traditional OOP sense; something with slots that you can get and set
<phoe>
s/slots/fields/ ;; if we want to use more traditional terminology
<fourier>
hello all, just want to check if the crowd is here after the conference
<MerlinTheWizard>
Ok, that makes more sense.
<phoe>
fourier: here and in #els2020
<fourier>
oh that channel as well, thanks
<fourier>
anyone able to quickload osicat on LispWorks 32bit for Linux ?
<MerlinTheWizard>
phoe, yes, that makes sense, it just doesn't really apply to the current example, except that a reference is being carried by a function.
ark has quit [Ping timeout: 244 seconds]
<fourier>
I would think the problem could be with any 32bit CL on Linux: Error: Unable to load any of the alternatives: ("librt.so.1" "librt.so")
<MerlinTheWizard>
Anyway, I'm probably getting it a little better now, so thanks everyone for your help.
<phoe>
MerlinTheWizard: that's the whole point - a reference to this place is carried around by these lambdas
<fourier>
while specifying the full path to 32bit variant of librt.so works..
ark has joined #lisp
cosimone has quit [Remote host closed the connection]
MerlinTheWizard has quit [Remote host closed the connection]
cosimone has joined #lisp
MerlinTheWizard has joined #lisp
schjetne has joined #lisp
<fourier>
apparently some magic with how cffi searches for libraries
<phoe>
_death: I don't think JPEGs are supposed to be stuffed in git repos, but oh well
<_death>
it's ok if they're small enough and you don't modify them
<phoe>
could be good then
<beach>
MerlinTheWizard: Not everything in Common Lisp is an object. A comment is not an object for instance. Neither is a place.
emys has quit [Ping timeout: 256 seconds]
emys has joined #lisp
<boeg>
does anyone know if let over lambda is available somewhere as epub?
Lycurgus has quit [Ping timeout: 264 seconds]
<phoe>
boeg: not in official distribution AFAIK
<boeg>
phoe: yeah, thats what i'm seeing too, too bad
Lycurgus has joined #lisp
Lycurgus has quit [Remote host closed the connection]
schjetne has quit [Read error: Connection reset by peer]
sauvin has quit [Read error: Connection reset by peer]
schjetne has joined #lisp
Bourne has quit [Ping timeout: 240 seconds]
emys has quit [Ping timeout: 246 seconds]
himmAllRight has quit [Remote host closed the connection]
himmAllRight has joined #lisp
<Cymew>
That metaobject jpg is really neat. :)
merkur has joined #lisp
merkur has quit [Remote host closed the connection]
emys has joined #lisp
himmAllRight has quit [Remote host closed the connection]
fourier has quit [Ping timeout: 244 seconds]
krid has joined #lisp
fourier has joined #lisp
emys has quit [Ping timeout: 260 seconds]
Aurora_v_kosmose has quit [Ping timeout: 240 seconds]
<gendl>
Hi, i just installed mysql on my mac with brew, set the root password, and quickloaded clsql in CCL. Can anyone give a quick pointer about how to connect to mysql from CL? And is clsql even what I should be using at this juncture?
shifty has quit [Ping timeout: 260 seconds]
shifty has joined #lisp
shangul has quit [Ping timeout: 244 seconds]
<gendl>
The manual seems to be missing from here: http://clsql.kpe.io/documentation.html and although Kevin Rosenberg has done some great stuff it seems he's not active these days...
<_death>
I suppose there could be an ifdef there.. but, good intentions and roads to hell
<fourier>
will try to compile latest ecl then before
<jackdaniel>
_death: thanks for sharing! I'll gladly play with it :)
<jackdaniel>
(and thank you for remembering my request for pinging me when you do that)
<_death>
thank you for keeping ECL alive :)
jasom has quit [Ping timeout: 256 seconds]
karlosz has quit [Quit: karlosz]
shifty has quit [Ping timeout: 244 seconds]
karlosz has joined #lisp
shifty has joined #lisp
jayde has joined #lisp
gabiruh has joined #lisp
CrazyEddy has joined #lisp
Oladon has joined #lisp
buffergn0me has joined #lisp
schjetne has joined #lisp
ayuce has quit [Read error: Connection reset by peer]
ayuce has joined #lisp
copec has joined #lisp
schjetne has quit [Ping timeout: 256 seconds]
koenig has left #lisp ["WeeChat 2.7"]
efm has joined #lisp
efm has quit [Client Quit]
emys has joined #lisp
<theseb>
Do people typically define their macros in a SEPARATE file or do they mix it with rest of their programs?
<theseb>
i'm guessing probably with something as elaborate as a DSL you want to squirrel it away in a separate file at least?
<phoe>
theseb: not all macros are worthy being called DSLs
<phoe>
e.g. if you have a WITH-FOO macro that expands into a CALL-WITH-FOO function or into a LET binding that binds some *FOO* variable, it's often not worth to define these in a separate file
duncan_ has quit [Ping timeout: 246 seconds]
shifty has quit [Ping timeout: 240 seconds]
efm has joined #lisp
shifty has joined #lisp
ahungry has quit [Remote host closed the connection]
akoana has joined #lisp
jasom has joined #lisp
prefixt has joined #lisp
<prefixt>
Hello! Is there an expedient means to generate a kind list of function calls for a program to be loaded in SBCL?
<phoe>
prefixt: I enjoyed reading that sentence but did not understand it
<phoe>
what program to be loaded? do you mean some Quicklisp system, or do you mean something else?
<fourier>
theseb: I even define them inside a function if I'm too lazy with macrolet
<fourier>
its a matter of taste, I guess
<theseb>
ok
<prefixt>
phoe, thank you! I have some lisp programs/scripts. I can read the source fine. I don't know exactly what SBCL is doing with the program internally, but if my program works, I can assume the the functions in my program/script have been executed at some point. I'd assume SBCL contain some of this information, like what functions were executed.
<phoe>
prefixt: this sounds like you want to use the TRACE facility
shifty has quit [Ping timeout: 260 seconds]
shifty has joined #lisp
keep_learning has joined #lisp
* prefixt
searches TRACE
<phoe>
before your program gets executed, you might want to TRACE some functions inside it; you should then get a printout of which functions were called with which arguments and then returned which values
<phoe>
like, if you have (defun foo ...) and (defun bar ...) in your program, then, before executing (foo) or (bar) you might first want to (trace foo bar)
schjetne has joined #lisp
<prefixt>
thank you phoe, that's extremely helpful and mostly what I was looking for. Let me look into this :-)
fourier has quit [Ping timeout: 244 seconds]
<phoe>
<3
* phoe
goes afk for sleep
schjetne has quit [Ping timeout: 256 seconds]
theBlackDragon has quit [Ping timeout: 258 seconds]
emys has quit [Ping timeout: 260 seconds]
bars0 has quit [Ping timeout: 264 seconds]
theBlackDragon has joined #lisp
emys has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<theseb>
apparently in addition to the evaluator some people call the thing that expands macros and converts 'a to (quote a) the ''expander" ?
twelvemonkeys has quit [Ping timeout: 260 seconds]
<theseb>
so reader -> expander -> evaluator -> printer yes?
<theseb>
REPL should be REEPL perhaps
twelvemonkeys has joined #lisp
gravicappa has quit [Ping timeout: 240 seconds]
efm has quit [Remote host closed the connection]
<Bike>
'a as (quote a) is just the reader
Inline has quit [Remote host closed the connection]
Inline has joined #lisp
shukryzablah has quit [Remote host closed the connection]
shangul has joined #lisp
<theseb>
Bike: what about the thing that expands macros?
<theseb>
reader too?
<theseb>
Bike: i guess we can fold the expansion function into the reader..all of it
Oladon has quit [Quit: Leaving.]
<Bike>
uh, no.
<LdBeth>
Macro expansion is eval part
<Bike>
the reader converts text into s-expressions. macroexpansion converts s-expressions into other s-expressions.
<theseb>
ok
<theseb>
thanks
schjetne has joined #lisp
emys has quit [Ping timeout: 264 seconds]
orivej has quit [Quit: orivej]
orivej has joined #lisp
ayuce has quit [Remote host closed the connection]
ayuce has joined #lisp
<pjb>
theseb: it could be E^n, since in your macro, you could also call (defmacro moo () (funcall (compile nil (eval (macroexpand (read-from-string #|or elsehwhere|# "(foo (bar (baz)))"))))))
<pjb>
and so on.
sjl_ has quit [Ping timeout: 246 seconds]
roelj has quit [Remote host closed the connection]
hiroaki has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 244 seconds]
ayuce has quit [Remote host closed the connection]
ayuce has joined #lisp
orivej has joined #lisp
MerlinTheWizard has joined #lisp
torbo has joined #lisp
hiroaki has joined #lisp
keep_learning has quit [Quit: This computer has gone to sleep]
SGASAU has quit [Remote host closed the connection]
didi has joined #lisp
SGASAU has joined #lisp
<didi>
How do I freeze the value of a dynamic value inside a lambda? For example, (defvar *foo* 42) (defun make-foo () (lambda () (freeze-now *foo*))) (let ((*foo* 7)) (funcall (make-foo))) => 42 # and not => 7
<no-defun-allowed>
You can't, that's why it's dynamic.
<didi>
no-defun-allowed: I see.
<Bike>
when is freeze-now supposed to do the freezing, exactly?
<Bike>
in your example, *foo* is bound to 7 even when the closure is created.
<no-defun-allowed>
You could bind the value to a lexical variable outside the LAMBDA and re-bind it to the dynamic variable inside the LAMBDA, though.
<didi>
Bike: During the creation of the lambda.
<Bike>
but then your example should still return 7, because the (make-foo) call is within the (let ((*foo* 7)) ...)
MerlinTheWizard has quit [Remote host closed the connection]
<didi>
Bike: Right, but I want 42. I want the lambda to be independent of the value of *foo*.
MerlinTheWizard has joined #lisp
<didi>
no-defun-allowed: Interesting.
shifty has quit [Ping timeout: 244 seconds]
<LdBeth>
Well free-now is possible by doing local renaming
<Bike>
How could it possibly be 42?
<LdBeth>
Like rename foo to a gensym
<Bike>
You call make-foo and *foo* is 42 even then.
<Bike>
er, is 7.
<didi>
LdBeth: Thanks.
shifty has joined #lisp
<didi>
Bike: I know it doesn't work. I want a way to make it work.
<Bike>
You could do (defun make-foo () (let ((foo *foo*)) (lambda () foo))) as no-defun-allowed alluded to, but your example would still return 7.
<Bike>
Because when make-foo is called, *foo* is 7, not 42. am i not being clear?
<didi>
No no. I want to (make-foo) to always return the original value of *foo*. No time dependence.
<Bike>
What if you (setf *foo* 3) somewhere?
<Bike>
Why not just do (defun make-foo () (lambda () 42))?
X-Scale has quit [Ping timeout: 258 seconds]
X-Scale` has joined #lisp
<didi>
Oh, well. I will think of something. Thank you.
X-Scale` is now known as X-Scale
renzhi has joined #lisp
davd has quit [Ping timeout: 240 seconds]
<Bike>
i mean, really, if you want a value that never changes, do (defconstant +foo+ 42) (defvar *foo* +foo+), and then use +foo+ for the unchanging one.
izh_ has quit [Quit: Leaving]
<didi>
Bike: I transverse a tree making lambdas. Some of these lambdas depend on a dynamic variable.
<didi>
I'm using `cond' to produce different lambdas, but it's not pretty.
<Bike>
you said you wanted the "original value". So even if you bind or set *foo*, the lambdas return the same value and ignore those bindings and sets. Or is that wrong?
Adamclisi has quit [Quit: leaving]
random-nick has quit [Ping timeout: 246 seconds]
frgo has quit [Remote host closed the connection]
<didi>
Instead of doing (if *foo* (lambda () 42) (lambda () 7)), I wanted to do (let ((*foo* 42)) (list (lambda () *foo*) (let ((*foo* 7)) (lambda () *foo*)))).
frgo has joined #lisp
<Bike>
and those functions return different things?
<didi>
Yes.
<Bike>
that would make it sensitive to bindings. it's not returning the original value.
<didi>
The binding at the time of `lambda' creation.
<Bike>
that's what (defun make-foo () (let ((foo *foo*)) (lambda () foo))) gets you, but that's not how it works with your earlier example.
MerlinTheWizard has quit [Ping timeout: 240 seconds]