kevingal has quit [Remote host closed the connection]
Algernon69 has quit [Ping timeout: 240 seconds]
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
copec_ has joined #commonlisp
antoszka_ has joined #commonlisp
jsatk__ has joined #commonlisp
mgxm has joined #commonlisp
hirez has joined #commonlisp
cpape`` has joined #commonlisp
|3b|` has joined #commonlisp
ogamita`` has joined #commonlisp
gin has joined #commonlisp
dale_ has joined #commonlisp
greaser|q has joined #commonlisp
White__Flame has joined #commonlisp
Guest4269 has joined #commonlisp
antoni has joined #commonlisp
drakonis1 has joined #commonlisp
jsatk_ has quit [Ping timeout: 240 seconds]
antoszka has quit [Ping timeout: 240 seconds]
gin_ has quit [Ping timeout: 240 seconds]
dale has quit [Ping timeout: 240 seconds]
epony has quit [Ping timeout: 240 seconds]
copec has quit [Ping timeout: 240 seconds]
cpape` has quit [Ping timeout: 240 seconds]
copec_ is now known as copec
kakuhen has quit [Ping timeout: 240 seconds]
Spawns_Carpet[m] has quit [Ping timeout: 240 seconds]
antoszka_ is now known as antoszka
dale_ is now known as dale
MetaYan has quit [Ping timeout: 240 seconds]
Arcsech has quit [Ping timeout: 240 seconds]
antoszka-r has quit [Ping timeout: 240 seconds]
lieven has quit [Ping timeout: 240 seconds]
White_Flame has quit [Ping timeout: 240 seconds]
ogamita` has quit [Ping timeout: 240 seconds]
|3b| has quit [Ping timeout: 240 seconds]
mgxm_ has quit [Ping timeout: 240 seconds]
empwilli has quit [Ping timeout: 240 seconds]
GreaseMonkey has quit [Ping timeout: 240 seconds]
drakonis has quit [Ping timeout: 240 seconds]
hirez- has quit [Ping timeout: 240 seconds]
jmes has quit [Remote host closed the connection]
epony has joined #commonlisp
random-nick has quit [Ping timeout: 256 seconds]
drakonis1 is now known as drakonis
empwilli has joined #commonlisp
MetaYan has joined #commonlisp
Jing has joined #commonlisp
Jing has quit [Client Quit]
Spawns_Carpet[m] has joined #commonlisp
Arcsech has joined #commonlisp
kakuhen has joined #commonlisp
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
euandreh has quit [Ping timeout: 240 seconds]
molson__ has quit [Quit: Leaving]
molson has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
euandreh has joined #commonlisp
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
morganw has quit [Remote host closed the connection]
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
lisp123 has joined #commonlisp
greaser|q has joined #commonlisp
greaser|q has quit [Changing host]
greaser|q is now known as GreaseMonkey
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
biog has quit [Quit: ZZZzzz…]
biog has joined #commonlisp
biog has quit [Ping timeout: 240 seconds]
waleee has quit [Ping timeout: 240 seconds]
igemnace has quit [Remote host closed the connection]
karlosz has joined #commonlisp
karlosz has quit [Client Quit]
pillton has joined #commonlisp
triffid has joined #commonlisp
Lord_Nightmare has quit [Ping timeout: 256 seconds]
waku has joined #commonlisp
<Josh_2>
I am getting odd behaviour with a macro
<Josh_2>
Ofcourse now I cannot replicate it :facepalm:
<pillton>
Bike: I was referring to operations involving AREF like (dotimes (i (length array)) (incf (aref array i))) where there is nothing you can do to hint that the index given to AREF and (SETF AREF) is always valid for ARRAY (well, something more sensible than (declare (optimize (speed 3) (safety 0)))). A "sufficiently smart" compiler could possibly derive that example, but what about more operations for more complex data structures e.g. a
<pillton>
heap? One could argue that the cost of the index check is negligble compared to some of the heap operations and thus not worth exploring.
<Colleen>
pillton: Bike said 13 hours, 36 minutes ago: "I think there should be another operator or operators introduced which either avoid using AREF or ensure that every call to AREF does not require checking its arguments." what do you mean?
<pillton>
Bike: Perhaps a better example is (dotimes (i (length array2)) (incf (aref array1 (aref array2 i)))).
<Josh_2>
Well idk, seems to be working now
<Bike>
pillton: ahh. i understand. that gets tricky if you contemplate concurrency though
<Bike>
clearly we just need to extend the language with dependent types
<pillton>
Bike: I get the concurrency argument, but I think there is something more fundamental that needs to be addressed.
<pillton>
Maybe the problem goes away if you define operations which operate on "blocks" with a fixed length i.e. simd operations?
|smlckz| has joined #commonlisp
<pillton>
But there has to be a safer way to implement optimize operations like matrix multiplication, SVD, proximity operators, heaps without resorting to (declare (optimize (speed 3) (safety 0))).
<|smlckz|>
hi, how can i enable syntax highlighting in the slime repl?
<Bike>
pillton: like actually dependent types though? maybe?
<pillton>
Bike: I'd have to look up what that means exactly.
<Bike>
pillton: short version would be like, the ability to declare that an array's length is some other variable.
lisp123 has joined #commonlisp
<Bike>
types that depend on variables.
<Spawns>
lisp macros can call any functions eval'd before the macro definition yeah? how does that work?
<pillton>
Bike: Ok. Right.
<Spawns>
i am at the point where the next thing i need to implement in my lisp is macros, but I'm not sure how to deal with generating bytecode and expanding macros that depend on programs, which are bytecode
<Spawns>
i am thinking to compile and interpreter a single expression at a time, and the compiler is going to have to be able to pass in data to be expanded while compiling
<pillton>
Bike: It sounds complicated.
<pillton>
looks*
<Bike>
Spawns: generally, the lisp compiler has access to a lisp interpreter or other way to evaluate lisp code. it then just calls the macro function on the code.
<Bike>
pillton: it is. makes your type system uncomputable and stuff. but lisp's already is, so hey
<Bike>
and i think it's fairly easy in particular cases, like this array thing
<Bike>
"this array is x long, so if (0 <= y < x), (aref array y) doesn't have to bounds check"
<moon-child>
Bike: why would you need an interpreter? Aside maybe from bootstrapping, I see no reason why you could not compile the macro body
<Bike>
moon-child: "or other way"
<moon-child>
sure. But given you have a compiler anyway, it seems strange not to use it
<Bike>
i didn't mean to say you couldn't use it. i am trying to explain this to someone who is perhaps not familiar with the internals of lisp implementations.
<Spawns>
that makes sense Bike !
<Spawns>
doesn't sound so bad
waku has joined #commonlisp
<beach>
Spawns: It shouldn't matter whether your Lisp functions are implemented as bytecodes, primitive functions in assembly, interpreted functions, native code, or anything else. A macro is expanded by a call to the macro function which is given an S-expression (and an environment in Common Lisp), and which returns another S-expression.
waku has quit [Ping timeout: 256 seconds]
tyson2 has quit [Remote host closed the connection]
abrantesasf has quit [Remote host closed the connection]
<Spawns>
if it was a treewalk interpreter it would be a little easier i think
asarch has joined #commonlisp
<beach>
No, calling a macro function would involve the exact same work then.
<beach>
Some other part of the system may be simplified, but not that one.
<beach>
Spawns: It is very hard to help you with this thing, because you are implementing a language for which we have no specification. So we have no way of knowing what kind of restrictions or generalizations your language has compared to Common Lisp. The best thing we can do is to let you know how things would be done in a typical Common Lisp implementation.
<Spawns>
thats actually very helpful beach
<Spawns>
i have so far been following the scheme spec fairly loosely
<Bike>
scheme macros are pretty different from common lisp ones.
<moon-child>
_the_ scheme spec? :)
<Spawns>
but i think hygienic macros will be too difficult for me to implement
<beach>
moon-child: Heh!
<Spawns>
the most recent version r7rs
<Spawns>
the "small" subset
<moon-child>
_the_ r7rs? :)
<beach>
Spawns: So with that in mind, in Common Lisp, a macro function is just an ordinary function that takes two arguments, a form and an environment object. The function builds a new form and returns it. It doesn't matter, then, whether the macro function is coded in assembly or something else.
<Spawns>
that makes a lot of sense!
<Spawns>
for some reason I was thinking it was going to be a lot more difficult
<Spawns>
once I have macros implemented and working I will have an actually capable lisp!
<Spawns>
the amount of work that goes into making a cl implementation must be intense
<beach>
Spawns: You can check this for yourself in a Common Lisp implementation: (funcall (macro-function 'when) '(when foo bar baz) nil)
<Josh_2>
Okay I have found that annoying bug again, ofcourse it occurred when I deployed my application to my VPS
<beach>
Spawns: Yes, I am well aware of the amount of work required. :)
<Josh_2>
Okay https://plaster.tymoon.eu/view/2871#2871 here I have at the top my macro, then in the middle the function using the macro and then at the bottom a condition that is signalled when evaluating a function (in a different package) that is using the function in the middle
semz has joined #commonlisp
semz has quit [Changing host]
semz has joined #commonlisp
<Josh_2>
Not sure why I am getting this error, the reason I had to use keys is an attempt to make conversion from destructuring-bind to with-hash-keys easier
semz_ has quit [Ping timeout: 250 seconds]
<Josh_2>
It was working earlier (ofcourse :( )
<Josh_2>
if I invoke rooms-in-a-space directly I get the same condition
<Josh_2>
hmmm I wonder if its because of what I think
<Josh_2>
and it was.... I was using the macro before it was defined :facepalm:
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
Bike has quit [Quit: Lost terminal]
lisp123 has quit [Quit: Leaving...]
<asarch>
If I have: '((:id 1 :name "taco") (:id 2 :name "pizza") (:id 3 :name "beer")), how could I remove (:id 2 :name "pizza")?
<asarch>
Well, actually, how could I remove '((:id 2 :name "pizza") (:id 1 :name "taco"))?
<Josh_2>
You can use remove with key?
<moon-child>
(remove-if (lambda (x) (and (= 2 (getf x :id)) (equal "pizza" (getf x :name)))))
<moon-child>
obviously could simplify if you only care about id or name matching, not both
<moon-child>
to remove multiple, probably transpose and then use MEMBER
<moon-child>
could use EQ if you guarantee structure-sharing ahead-of-time. Or use a hash table if you have a bunch of elements to remove
<asarch>
Then I could have '((:id 1 :name "taco") (:id 2 :name "pizza") (:id 3 :name "beer")) and then a list of ids '(1 2)
<asarch>
(loop for element in '((:id 1 :name "taco") (:id 2 :name "pizza") (:id 3 :name "beer")) do (remove-if ... <- ?
<moon-child>
sure. Then I would say (remove-if (lambda (x) (member x ids)))
triffid has quit [Quit: triffid]
<Josh_2>
Instead of getf you can use (destructuring-bind ..) it'll look nicer
<moon-child>
err (member (getf x :id) ids)...
<Josh_2>
asarch: you would be better off using when .. collect
<moon-child>
I am not sure why you have a loop there
<asarch>
How would you do it?
<moon-child>
(loop for x in ... unless (member (getf x :id) ids) collect x)
<moon-child>
another way, using loop
<Josh_2>
yeh
<moon-child>
but I prefer remove-if in this case. Imo loop is better for complex things
<moon-child>
remove-if says exactly what it does: you're removing some elements from a list. It is more specific
triffid has joined #commonlisp
waku has joined #commonlisp
<asarch>
But how can I pass the list of the elements I want to delete?: (remove-if (lambda (x) (member x '((:id 1 :name "taco") (:id 2 :name "pizza") (:id 3 :name "beer")))))
<moon-child>
asarch: nb. assuming the layout of a plist will get you into trouble
<moon-child>
what if somebody says (:name "taco" :id 1) instead?
<asarch>
Good point
z3t0 has joined #commonlisp
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
<Spawns>
is it possible to have my interpreter's implementation of conses as an immutable data structure but provide a mutable api to the lisp itself? do any cl implementations do something like that?
<Spawns>
i am sort of confused how you could implement that, since lists don't store pointers going backwards
<Spawns>
appending and pushing is easy, but doing set-car or whatever to an element in the middle is tricky
<beach>
Spawns: I have no idea what that means. Mutability doesn't seem to have anything to do with back pointers.
<Spawns>
how can you create a new list when doing "set-car" in the middle of a list, if you can't copy the list from front to back with just that part of it changed
<beach>
And I don't see the difficulty of doing a RPLACA "in the middle" whatever that might mean.
<beach>
Spawns: Common Lisp doesn't have an operator named SET-CAR.
<beach>
Also, Common Lisp does not have immutable lists.
<Spawns>
like with appending, you just make a brand new list with an extra element tacked on the end, pushing you do the same but with the front. setting a car however, just gives you a single cons cell from the list, so you don't know how to return an entirely new list with just that part changed
<Spawns>
immutable in the sense of python strings being immutable
<beach>
Right, RPLACA is an operator that mutates the CONS cell.
<Spawns>
that requires the underlying repr to be mutable i guess
<Spawns>
i don't think there is an easy way around it
<Spawns>
can't you do like (setf (cddr list) nil)
<beach>
Sure you can.
<moon-child>
Spawns: obviously, immutable languages are turing-complete, so you _can_ implement a mutable language in terms of immutable semantics
<beach>
But that's an unrelated question.
<moon-child>
however, it will be very difficult to implement, and perform poorly
<Spawns>
beach: setf only knows about the specific cons cell that cddr returns
<moon-child>
beach: 'Common Lisp does not have immutable lists' literals? scnr
<moon-child>
Spawns: setf is a macro. In the case of CDDR, that will expand to something like (rplacd (cdr list) nil)
<beach>
I would appreciate not being corrected when I attempt a pedagogical approximation to a newbie.
<Spawns>
i think you are right about performance moon-child, that will be a lot of allocations and general churn
<Spawns>
the main reason I am asking is because doing mutable link lists in rust is a massive annoyance
<beach>
Spawns: More generally, this is a channel for Common Lisp. You are attempting the implementation of a different language for which we have no specification, so it is nearly impossible to give you advice.
<beach>
Spawns: I think you need to phrase your questions in terms of how Common Lisp is or can be implemented.
sloanr has quit [Ping timeout: 256 seconds]
<moon-child>
Spawns: I think I told you before that trying to implement lisp in rust was not going to work out
<Spawns>
i was curious if you are familiar with how cl implementations implement their lists beach
<Spawns>
moon-child: yeah heh
<beach>
Spawns: Yes, I am.
<beach>
minion: Please tell Spawns about SICL.
<minion>
Spawns: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL
<Spawns>
how does bootstrapping that work beach ?
<beach>
Spawns: Usually, a CONS cell consists of two consecutive words in memory, and a list is just a sequence of CONS cells, linked by their CDR.
<beach>
Spawns: SICL bootstrapping? The compiler is written in Common Lisp and generates native code. Or will, when we are done.
<Spawns>
oh yeah that makes sense, very cool
<beach>
It's pretty standard practice to implement a language in itself.
<beach>
Spawns: You might want to read the paper by Krystof, entitled "SBCL, a Sanely Bootstrappable Common Lisp". SBCL is mostly written in Common Lisp as well.
<Spawns>
I did not realize that about SBCL, that's very interesting
<Spawns>
sure i'll look for it if its online
<beach>
Spawns: You might also watch my videos for the online Lisp meeting, entitled "Creating a Common Lisp implementation".
<Spawns>
is that from a channel "Online Lisp Meetings"?
<beach>
I think that's what I said, yes.
<beach>
Well, I don't know that there is a channel for it.
<Spawns>
that's the first result that showed up on google, a youtube channel
<beach>
Then that's it.
<moon-child>
all youtube videos are associated with a 'channel', afaik
alvaro121 has quit [Ping timeout: 256 seconds]
sloanr has joined #commonlisp
lisp123 has joined #commonlisp
aartaka has joined #commonlisp
waku has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
notzmv has quit [Ping timeout: 240 seconds]
Krystof has quit [Ping timeout: 256 seconds]
asarch has quit [Quit: Leaving]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
sloanr has quit [Remote host closed the connection]
thomaslewis has joined #commonlisp
sloanr has joined #commonlisp
waku has quit [Ping timeout: 250 seconds]
thomaslewis has left #commonlisp [#commonlisp]
xantoz has quit [Read error: Connection reset by peer]
bollu has quit [Quit: Ping timeout (120 seconds)]
xantoz has joined #commonlisp
bollu has joined #commonlisp
<ns12>
Hello, in "EVAL-WHEN considered harmful to your mental health" (https://fare.livejournal.com/146698.html), I see "The Lisp processor reads a stream of text (an unfortunate choice of specification, INTERLISP and Smalltalk fans may tell you) ...".
<ns12>
What is the meaning of that? What do Interlisp and Smalltalk have?
Oddity has joined #commonlisp
<beach>
ns12: I am just guessing, but I think it means that Common Lisp is based on keeping source code in files, and those other systems are more "image based".
<ns12>
That makes sense. Thank you.
<beach>
Sure.
pieguy128_ has quit [Ping timeout: 240 seconds]
waku has joined #commonlisp
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
pieguy128 has joined #commonlisp
pve has joined #commonlisp
lisp123 has quit [Quit: Leaving...]
varjag has joined #commonlisp
varjag has quit [Ping timeout: 250 seconds]
epony has quit [Quit: QUIT]
lisp123 has joined #commonlisp
epony has joined #commonlisp
rgherdt has joined #commonlisp
xantoz has quit [Ping timeout: 256 seconds]
xantoz has joined #commonlisp
Colleen has quit [Remote host closed the connection]
<pjb>
ns12: it's just the matter of developping a few tools, including a nice editor. there's CL:ED but most implementations defer to an external program or don't implement it.
<phoe>
and there's the problem where images accumulate cruft over time - and Smalltalk and Interlisp images are no exception
<moon-child>
ource code accumulates cruft over time too :)
<phoe>
sure, but textual source code is inspectable easier than images which are composed of many things that are impossible to show as text
<phoe>
while text as a representation of source code has many downsides, this one is a clear upside
<moon-child>
I may ask my image (or, at least, ought to be able to ask my image) not only 'show me all the objects', but also 'show me all the relationships between the objects'
<akater[m]>
I've seen a tool that converts textual image diffs into visual image diffs
<moon-child>
which would seem to make it much more amenable to introspection
<akater[m]>
oh it's about Lisp image? sorry
<akater[m]>
How expensive would it be to keep a registry of all objects, or at least of objects of all interesting classes to make cruft more manageable? (Maybe commercial Lisps do this already, I don't know)
notzmv has joined #commonlisp
<phoe>
maybe you don't need to do that - you should be able to walk the whole image in order to find interesting objects
<phoe>
SBCL's maproot functionality allows you to do that
<moon-child>
hmm, it looks like that requires you to supply a root
shka has joined #commonlisp
<phoe>
er, one second, might have misremembered the name
<moon-child>
so you can't so easily say 'trace _all_ the objects in the image' (as a gc would, say). (I assume that it still is possible, though)
<moon-child>
map-root
<moon-child>
missed a -
<akater[m]>
I didn't know about map-root, thank you.
<beach>
cage: Look in the glossary for "string designator"
<rotateq>
cage: by logic it should really just work on objects of class STRING
<rotateq>
OK, also symbols!
<rotateq>
beach: I had luck you mentioned the designators.
<beach>
cage: Do you see the definition?
<cage>
beach: yes, string= works for string designator
<beach>
cage: I mean, do you see the definition of "string designator"?
<beach>
rotateq: You need to make sure you know the definition before attempting to help.
<cage>
a symbol is a string designator and 'nil' is a symbol
<beach>
Right, and then it designates what?
<cage>
so string= works for nil
<rotateq>
Yes, I apologize.
<cage>
beach: "NIL" ?
<beach>
cage: So string= is really called with "NIL" and "NIL".
<cage>
so it works :)
<beach>
See, you figured it out almost all by yourself.
paul0 has quit [Remote host closed the connection]
<cage>
beach: thanks for helping me to figure out it! :D
Guest4269 is now known as mal
<beach>
Pleasure.
<cage>
:)
mal is now known as Guest2660
paul0 has joined #commonlisp
<mcoll>
Thoughts on the commercial lisp offerings? Allegro and LispWorks, anyone using them?
<phoe>
both of them finally have package-local nicknames now that LW8 is released!
* phoe
is happy
marcoxa has quit [Ping timeout: 250 seconds]
paul0 has quit [Remote host closed the connection]
<rotateq>
nice
paul0 has joined #commonlisp
Guest2660 is now known as lieven
kevingal has joined #commonlisp
kevingal_ has joined #commonlisp
gaqwas has joined #commonlisp
gaqwas has quit [Remote host closed the connection]
<cage>
phoe: great!
tyson2 has joined #commonlisp
azimut has joined #commonlisp
<mcoll>
phoe: do you use LW?
<nij->
Isn't SBCL good enough @@? I'm curious.
<phoe>
mcoll: nope, SBCL herwe
<phoe>
here*
<mcoll>
yeah, probably, CAPI is the main attraction to me I guess
taiju has joined #commonlisp
<Shinmera>
mcoll: You won't find many people using them on "freenode". If you want better insights, throw a mail to their mailing lists, or look at their appraisals that they list on their websites.
<rotateq>
or using CCL, ECL, ...
<rotateq>
but surely, LW and ACL come with many things on top too
<lisp123>
You will have to figure out a way of copying the faces from lisp major mode to slime repl (C-h m should tell you what the exact major mode of the slime repl is called)
iamFIREcracker has quit [Ping timeout: 256 seconds]
iamFIREcracker has joined #commonlisp
cosimone has quit [Remote host closed the connection]
marcoxa has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
epolanski has quit [Quit: Connection closed for inactivity]
<Josh_2>
Hello
lisp123 has joined #commonlisp
VincentV` has quit [Ping timeout: 250 seconds]
cosimone has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
<kevingal_>
What I want to know is how to stop everything in the REPL being coloured a string after there's an error message with a newline in it.
<kevingal_>
(At least, I think that's what causes it).
<kevingal_>
YES, confirmed.
<kevingal_>
(error (format nil "well heck~%"))
frgo has joined #commonlisp
<edgar-rft>
kevingal_: what REPL are you talking about? Emacs/Slime or some CL implementation running in a terminal emulator?
<kevingal_>
Emacs/SLIME.
* semz
can't reproduce this in Emacs/SLIME 27.2/2.26.1
* edgar-rft
can't reproduce this either
<kevingal_>
Oh, I'm on Emacs 26.3 and SLIME 2.26.1.
<kevingal_>
I'm afraid to upgrade Emacs in case something else breaks.
thomp has joined #commonlisp
Bi[m] has quit [Quit: You have been kicked for being idle]
epolanski has joined #commonlisp
jealousmonk has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
mgl has quit [Ping timeout: 256 seconds]
kevingal_ has quit [Remote host closed the connection]
kevingal has quit [Read error: Connection reset by peer]
iamFIREc1 has joined #commonlisp
thomp has quit [Ping timeout: 250 seconds]
iamFIREcracker has quit [Ping timeout: 256 seconds]
cosimone` has joined #commonlisp
cosimone has quit [Ping timeout: 250 seconds]
pillton has quit [Quit: ERC (IRC client for Emacs 27.2)]
frgo has quit [Read error: Connection reset by peer]
frgo_ has joined #commonlisp
frgo_ has quit [Read error: Connection reset by peer]
frgo has joined #commonlisp
phantomics has quit [Ping timeout: 256 seconds]
monaaraj has joined #commonlisp
iamFIREc1 has quit [Ping timeout: 256 seconds]
Guest7498 has joined #commonlisp
thomp has joined #commonlisp
thomaslewis has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.4]
perrierjouet has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
triffid has quit [Quit: triffid]
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
amb007 has quit [Remote host closed the connection]
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
amb007 has joined #commonlisp
jstoddard has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
gaqwas has joined #commonlisp
jstoddard has quit [Remote host closed the connection]
jstoddard_ has joined #commonlisp
jstoddard_ is now known as jstoddard
amb007 has quit [Ping timeout: 240 seconds]
varjag has quit [Ping timeout: 256 seconds]
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
perrierjouet has quit [Quit: WeeChat 3.4]
amb007 has joined #commonlisp
<sveit_>
if i'm using symbols as flags inside of a function, is there a reason to prefer keyword, uninterned, or "normal" symbols?
<White_Flame>
depends on how broadly they're passed around
<White_Flame>
also, even if they're purely internally used within your function, keywords can higlight in your source code and have a good visual distinction from your local var names
<sveit_>
say that they are meant to be used exactly in the scope of the function body (otherwise I guess uninterned would not work)
treflip has joined #commonlisp
<sveit_>
something like (lambda (x) (let ((size (cond ((> x 7) 'big) ((< x 3) 'small) (t 'unknown)))) (when (eql x 'big) "wow")))
sloanr has quit [Ping timeout: 256 seconds]
<sveit_>
whoops, should be (eql size 'big')
<White_Flame>
'big
<White_Flame>
but yeah, it really doesn't matter
<White_Flame>
just stylistically
<White_Flame>
for simple cases like that, local vars used as flags can be simpler & faster
<White_Flame>
but I could sort of see if you have a ton of potential symbols that you're using to organize it
<sveit_>
in reality, i have a slightly more non-trivial usecase: i have a relatively small (5) number of numbers in some numerical algorithm, a b c d e, and want to know their relative ordering to decide on the order other parts of the algorithm will run. the most reasonable thing seemed to be to do something like (sort (list (cons 'a a) (cons 'b b) ...) #'< :key #'cdr), which inspired this question
<sveit_>
i could write some forest of conditionals, but this seemed like a more reasonable approach. if you have a better solution actually i'd really like to see it
sloanr has joined #commonlisp
sloanr has quit [Remote host closed the connection]
monaaraj has quit [Ping timeout: 250 seconds]
thomp has quit [Ping timeout: 240 seconds]
monaaraj has joined #commonlisp
perrierjouet has joined #commonlisp
<White_Flame>
sveit_: makes sense to me
<White_Flame>
the symbols allow you to convert it all to runtime data & manipulate it with SORT, which is reasonable
varjag has joined #commonlisp
gaqwas has quit [Remote host closed the connection]
euandreh has quit [Ping timeout: 250 seconds]
treflip has quit [Remote host closed the connection]
marcoxa has quit [Ping timeout: 250 seconds]
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
tyson2 has quit [Remote host closed the connection]
pranavats has left #commonlisp [Error from remote client]
pranavats has joined #commonlisp
lisp123 has joined #commonlisp
waleee has joined #commonlisp
<sveit_>
is there a way to put multiple loop statements under a conditional clause? I mean something like (loop for j from 0 below 10 when (evenp j) { collect j into numbers collect (floor j 2) into halves } finally (return (values numbers halves)))
<sveit_>
where the braces are of course a fake syntax, but indicate when I would like the collections to run
lisp123 has quit [Ping timeout: 256 seconds]
<semz>
collect j into numbers and collect (floor j 2) into halves
<random-nick>
and being a piece of syntax valid in conditional clauses
<phoe>
"The consequences are undefined if the lexical environment surrounding the function to be compiled contains any bindings other than those for macros, symbol macros, or declarations."
<phoe>
what does this part mean? that COMPILE cannot produce closures?
<Bike>
"The consequences of calling compile on a function that is already compiled are unspecified." yeesh, that's perverse
frgo_ has joined #commonlisp
<phoe>
hey wait a second, that isn't CLHS
<phoe>
"If the definition is already a compiled function, compile either produces that function itself (i.e., is an identity operation) or an equivalent function."
<Bike>
hmm. not sure there's anything mandating it be a compiled-function, though in practice it will be. and it's also mandated that it be at least minimally compiled regardless
<phoe>
"Functions produced by the compile function are of type compiled-function."
<phoe>
that obviously refers to the "outer" lambda, but how about the inner one
<phoe>
and I know that it'll be in practice, I'm just nitpicking at the specification now
<Bike>
the observable effect of compilation is the minimal compilation requirements, and that would have to apply to the inner function
<Bike>
even if it wasn't a compiled-function for some technical bullshit reason
<phoe>
yes
|3b|` is now known as |3b|
<Guest95>
SBCL is signaling a UNDEFINED-FUNCTION condition when I try to load my system with QUICKLISP:QUICKLOAD. The reason is because I use the function before it is defined in the file and I can fix the problem by moving the function definition above its invocation. I am confused about this though because I thought that you could use a function before you
<Guest95>
define it within the same compilation unit.
<phoe>
Guest95: depends
<phoe>
how do you use it?
<phoe>
do you use it inside a function body or macro body?
<phoe>
or do you have your file contents like (foo 42) ... (defun foo (x) ...) ?
<Guest95>
I use the function to create the initial value for a dynamic variable
<phoe>
oooh
<phoe>
then that won't work
<phoe>
the compiler needs to be able to call a function in order to initialize a global variable
<phoe>
and for that the function must already be defined
<phoe>
so it must be earlier in the file
<phoe>
you can do things like (defun bar () (foo)) ... (defun foo () ...)
<Guest95>
ok its clear now
<phoe>
but note that that doesn't require FOO to be actually called
<phoe>
(defvar *x* (foo)) does require FOO to be called in order to produce a value for *X*
<phoe>
whereas (defun bar () (foo)) or, alternatively, (lambda () (foo)), doesn't require that
varjag has joined #commonlisp
wyrd has quit [Remote host closed the connection]
wyrd has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
Guest95 has quit [Quit: Client closed]
perrierjouet has quit [Quit: WeeChat 3.4]
gaqwas has joined #commonlisp
perrierjouet has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
z3t0 has quit [Read error: Connection reset by peer]
z3t0 has joined #commonlisp
lottaquestions has quit [Quit: Konversation terminated!]
cosimone` has quit [Remote host closed the connection]
cosimone has joined #commonlisp
monaaraj has quit [Ping timeout: 256 seconds]
monaaraj has joined #commonlisp
random-nick has quit [Read error: Connection reset by peer]
rgherdt has quit [Ping timeout: 240 seconds]
karlosz has joined #commonlisp
pve has quit [Quit: leaving]
gaqwas has quit [Remote host closed the connection]