<bitblit1>
pjb: How would I modify that to make it permutations of a list. I thought of binary but that has repitition?
ec has joined #commonlisp
ec has quit [Ping timeout: 240 seconds]
<bitblit1>
What is the easy way of grouping a list into sublists for e.g: '(9 2 7 8 4 1 0 4 6 3) in groups of 2 => '((9 2) (7 8) (4 1)...)
<beach>
Something like (loop for (x y) on list by #'cddr collect (list x y))
ec_ has joined #commonlisp
<bitblit1>
Thanks beach However, this is dependent on the cddr function, if we wanted to lets say take pairs of 12 that would be really difficult
<bitblit1>
Also, don't you think the lambda syntax in common lisp is too lengthy?
<bitblit1>
And is there no ANY function, like there is NOTANY, EVERY but what is with ANY?
ec_ has quit [Ping timeout: 240 seconds]
<bitblit1>
beach: I wanted to make something dynamic which pairs depending on a number in this case (list x y z) is also not dependent
<bitblit1>
s/not//
ec_ has joined #commonlisp
<beach>
I figured you would change the requirements after the fact.
<beach>
What "lambda syntax" are you referring to?
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
rainthree has joined #commonlisp
<bitblit1>
(lambda (x) (cddr x))
Brucio-61 has quit [Ping timeout: 240 seconds]
ec_ has quit [Ping timeout: 240 seconds]
Prokhor_ has joined #commonlisp
<Prokhor_>
hi
varjag has joined #commonlisp
ec_ has joined #commonlisp
<Prokhor_>
i have a question specific on "common prolog" from lispworks but it follows cl implementation rules: I have an assertion like: (assert ((color red))) which gives: (color red) -> YES now i would like to know how how i could do sth like: (setq pred1 human) (setq val1 socrates) and (assert ((pred1 val1))
Brucio-61 has joined #commonlisp
<Prokhor_>
if i do like above, it takes the var names literally and does not fill in the values associated (i.e. it uses the symbol slot (?))
alcor has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
MajorBiscuit has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 256 seconds]
Inline has joined #commonlisp
Inline has quit [Client Quit]
Brucio-61 has quit [Ping timeout: 268 seconds]
Brucio-61 has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
attila_lendvai has joined #commonlisp
MajorBiscuit has joined #commonlisp
ec_ has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
LW has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
NicknameJohn has quit [Ping timeout: 240 seconds]
pve has joined #commonlisp
dcb has quit [Quit: MSN Messenger 3.8]
ec_ has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
LW has quit [Quit: WeeChat 3.8]
ec_ has joined #commonlisp
mgl has joined #commonlisp
<White_Flame>
prokhor_: you could try defining ?pred1 and ?val1 prolog vars and using those in your expression
ec_ has quit [Ping timeout: 240 seconds]
<Prokhor_>
nice idea! but doesnt that just postpone the problem? (i would like to have masks like '((?pred ?var &?vars)) to make assertions from input...
<hayley>
White_Flame: Having PRED1 be a variable would be second-order logic, right? Dunno LispWorks but Prolog is all first-order to my knowledge.
<hayley>
Though here there's only one possible value for ?PRED1.
ec_ has joined #commonlisp
<beach>
bitblit1: Why are you asking me about the LAMBDA syntax? I suggested nothing with lambda in it. Or was this just an unrelated question?
rgherdt has quit [Ping timeout: 250 seconds]
<jackdaniel>
fe[nl]ix: congrats of the bt2 release!
<bitblit1>
pjb: really did it with these libraries. Truly Awesome!
<bitblit1>
s/://
Brucio-61 has quit [Ping timeout: 260 seconds]
rainthree3 has joined #commonlisp
attila_lendvai has joined #commonlisp
ec_ has joined #commonlisp
<Josh_2>
ogamita: I like that solution, its more general purpose :) Thanks
MajorBiscuit has quit [Ping timeout: 250 seconds]
MajorBiscuit has joined #commonlisp
Brucio-61 has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
Cymew has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
Brucio-61 has quit [Ping timeout: 260 seconds]
Brucio-61 has joined #commonlisp
sirufer has quit [Remote host closed the connection]
ashpool has quit [Remote host closed the connection]
payphone has quit [Remote host closed the connection]
jonlevin has quit [Remote host closed the connection]
jmbr has quit [Remote host closed the connection]
sm2n has quit [Remote host closed the connection]
chiheisen has quit [Remote host closed the connection]
alethkit has quit [Remote host closed the connection]
Schnouki has quit [Remote host closed the connection]
shunter has quit [Remote host closed the connection]
\f has quit [Remote host closed the connection]
cpli has quit [Remote host closed the connection]
jasom has quit [Remote host closed the connection]
artyn has quit [Remote host closed the connection]
mhcat has quit [Remote host closed the connection]
srhm has quit [Remote host closed the connection]
whereiseveryone has quit [Remote host closed the connection]
pvac has quit [Remote host closed the connection]
milesrout has quit [Remote host closed the connection]
theesm has quit [Remote host closed the connection]
ggb has quit [Remote host closed the connection]
mcoll has quit [Remote host closed the connection]
theothornhill has quit [Remote host closed the connection]
skin has quit [Remote host closed the connection]
zoglesby has quit [Remote host closed the connection]
zyd has quit [Remote host closed the connection]
timmy has quit [Remote host closed the connection]
nytpu has quit [Remote host closed the connection]
sirufer has joined #commonlisp
shunter has joined #commonlisp
pvac has joined #commonlisp
zoglesby has joined #commonlisp
mhcat has joined #commonlisp
Schnouki has joined #commonlisp
ggb has joined #commonlisp
payphone has joined #commonlisp
jasom has joined #commonlisp
chiheisen has joined #commonlisp
cpli has joined #commonlisp
skin has joined #commonlisp
sm2n has joined #commonlisp
mcoll has joined #commonlisp
timmy has joined #commonlisp
alethkit has joined #commonlisp
artyn has joined #commonlisp
theesm has joined #commonlisp
zyd has joined #commonlisp
jonlevin has joined #commonlisp
ashpool has joined #commonlisp
jmbr has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
srhm has joined #commonlisp
whereiseveryone has joined #commonlisp
milesrout has joined #commonlisp
\f has joined #commonlisp
nytpu has joined #commonlisp
theothornhill has joined #commonlisp
ec_ has joined #commonlisp
msavoritias has quit [Remote host closed the connection]
rgherdt has quit [Ping timeout: 240 seconds]
msavoritias has joined #commonlisp
scymtym has joined #commonlisp
attila_lendvai has quit [Ping timeout: 240 seconds]
Josh_2 has quit [Ping timeout: 240 seconds]
ec_ has quit [Ping timeout: 240 seconds]
random-nick has joined #commonlisp
ec_ has joined #commonlisp
rgherdt has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 240 seconds]
MajorBiscuit has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
mgl has quit [Quit: Client closed]
Gleefre has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
tevo has quit [Read error: Connection reset by peer]
ec_ has joined #commonlisp
tevo has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
jeosol has quit [Quit: Client closed]
ec_ has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
mgl has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 28.2]
didi has joined #commonlisp
<didi>
Can I reliably compare functions for equality? I want to write a function that internally uses a hashtable (for performance) if a certain parameter is (member eq eql equal equalp), so I need to know if the parameter is one of these, otherwise I will not use the hashtable.
<White_Flame>
literally, yes. function objects are EQ comparable
<didi>
Great. Thank you, White_Flame.
<White_Flame>
however, if you're looking at parameters to make-hashtable, that takes function designators, which would be a symbol, too
<didi>
Hum.
<didi>
Nah, the caller doesn't need to know about it. I can explicitly ask for functions.
<didi>
Or if one pass a symbol, I will use the generic implementation.
ec_ has quit [Ping timeout: 240 seconds]
<didi>
This is just a performance hack.
ec_ has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
<_death>
didi: note that the result of, say, (lambda () 42) may or may not be EQ to previous results obtained by its evaluation
didi has quit [Read error: Connection reset by peer]
ec_ has quit [Ping timeout: 240 seconds]
bird_ has quit [Ping timeout: 248 seconds]
ec_ has joined #commonlisp
szkl has joined #commonlisp
Brucio-61 has quit [Ping timeout: 260 seconds]
scymtym has quit [Ping timeout: 248 seconds]
ec_ has quit [Ping timeout: 240 seconds]
Brucio-61 has joined #commonlisp
ec_ has joined #commonlisp
qhong_ has joined #commonlisp
qhong has quit [Ping timeout: 265 seconds]
Brucio-61 has quit [Ping timeout: 260 seconds]
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
mgl has quit [Quit: Client closed]
Brucio-61 has joined #commonlisp
tyson2 has joined #commonlisp
scymtym has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
MajorBiscuit has quit [Ping timeout: 250 seconds]
MajorBiscuit has joined #commonlisp
ec_ has joined #commonlisp
<fe[nl]ix>
jackdaniel: thanks
MajorBiscuit has quit [Ping timeout: 268 seconds]
MajorBiscuit has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
rgherdt has quit [Ping timeout: 265 seconds]
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
zxcvz has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
morganw has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
johnjaye has quit [Ping timeout: 268 seconds]
ec_ has joined #commonlisp
rgherdt has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 250 seconds]
dirtcastle has quit [Ping timeout: 248 seconds]
akonai has quit [Quit: Quit.]
akonai has joined #commonlisp
deadmarshal_ has quit [Ping timeout: 260 seconds]
bird_ has joined #commonlisp
MajorBiscuit has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 246 seconds]
alcor has quit [Remote host closed the connection]
ec_ has quit [Ping timeout: 240 seconds]
MajorBiscuit has joined #commonlisp
ec_ has joined #commonlisp
tane has joined #commonlisp
tane has joined #commonlisp
tane has quit [Changing host]
bird_ has quit [Ping timeout: 246 seconds]
rainthree has quit [Read error: Connection reset by peer]
rainthree3 has quit [Read error: Connection reset by peer]
rainthree has joined #commonlisp
rainthree33 has joined #commonlisp
zxcvz has quit [Quit: zxcvz]
dirtcastle has joined #commonlisp
deadmarshal_ has joined #commonlisp
msavoritias has quit [Read error: Connection reset by peer]
MajorBiscuit has quit [Ping timeout: 240 seconds]
msavoritias has joined #commonlisp
szkl has quit [Quit: Connection closed for inactivity]
bird_ has joined #commonlisp
fe[nl]ix has quit [Remote host closed the connection]
cosimone has joined #commonlisp
fe[nl]ix has joined #commonlisp
euandreh has quit [Ping timeout: 240 seconds]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
ec_ has quit [Ping timeout: 240 seconds]
didi has joined #commonlisp
cage has joined #commonlisp
ec_ has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
alcor has joined #commonlisp
ec_ has joined #commonlisp
masinter has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
dcb has joined #commonlisp
tyson2 has joined #commonlisp
makomo has quit [Ping timeout: 250 seconds]
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
attila_lendvai has joined #commonlisp
rainthree33 has quit [Quit: Leaving]
ec_ has quit [Ping timeout: 240 seconds]
<didi>
Is there a function to map sequence elements which accepts the arguments :start, :end, and :from-end? I'm using `find-if' with a predicate that always returns nil, but it feels wrong. `map' is the obvious candidate, but I need to `subseq' and `nreverse' the input sequence myself.
ec_ has joined #commonlisp
tyson2` has joined #commonlisp
tyson2` has quit [Remote host closed the connection]
tyson2 has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
<Bike>
there is nothing built in for that
<_death>
REDUCE is pretty close, if you pass the right function
NicknameJohn has joined #commonlisp
<jackdaniel>
didi: find-if is a very nice solution to this if you don't expect more than a one sequence
<jackdaniel>
(setf (fdefinition 'map*) (curry #'find-if (constantly nil))) will wrap it nicely for you
<didi>
Great. Thank you all.
ec_ has quit [Ping timeout: 240 seconds]
<jackdaniel>
n.b for mapping over trees I'm using subst-if with the same predicate
<didi>
jackdaniel: Makes sense.
ec_ has joined #commonlisp
NicknameJohn has quit [Ping timeout: 240 seconds]
nij- has joined #commonlisp
<didi>
jackdaniel: In (setf (fdefinition 'map*) (curry #'find-if (constantly nil))), how do you process each element? I mean, the predicate is only a constant function. Mine is something like (lambda (x) (process x) nil).
<_death>
probably meant something like (lambda (f xs &rest args) (apply #'find-if (conjoin f (constantly nil)) xs args))
mgl has joined #commonlisp
morganw has quit [Remote host closed the connection]
<_death>
alternatively pass f for :key
<mgl>
Is it possible to find the name of the defun/defmacro/etc in which a macro is being expanded? I only had a quick look at cltl2 lexical environments ... maybe it's there?
<_death>
I guess you could write compiler-specific code to find it out (if it's even there) but probably the ordinary solution (still rare) would be to have your own defun/defmacro/etc. macros that allow the code to keep track of this
jmiven has quit [Quit: reboot]
jmiven has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
cosimone has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
<mgl>
Thanks. I'll think of another way.
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
morganw has joined #commonlisp
nij- has quit [Remote host closed the connection]
semz has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
tyson2 has quit [Remote host closed the connection]
<jackdaniel>
so Monkey Island was |xxx| this close to be the Alien Island ,)
<Bike>
huh, neat
<pjb>
didi: I answerd to your question "Is there a function to map sequence elements which accepts the arguments :start, :end, and :from-end?" (defun map-sequence (rtype fun sequence &key (start 0) end &aux (end (or end (length sequence)))) (map rtype fun (remove-if-not (range start end) sequence))) (map-sequence 'vector 'identity (iota 10) :start 3 :end 5) #| --> #(3 4 5) |#
<pjb>
didi: :from-end left as exercise to the reader.
<pjb>
didi: Note that in general :from-end doesn't mean reverse or right to left processing in the other sequence functions. It just mean semantically right-most result.
<pjb>
so a find :from-end could actually scan from left to right and just return the last result.
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
tyson2 has joined #commonlisp
rainthree has quit [Read error: Connection reset by peer]
Inline has quit [Ping timeout: 250 seconds]
ec_ has quit [Ping timeout: 240 seconds]
euandreh has joined #commonlisp
ec_ has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
Krystof has quit [Ping timeout: 240 seconds]
euandreh has quit [Quit: euandreh]
euandreh has joined #commonlisp
shka has quit [Read error: Connection reset by peer]
shka has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
euandreh has quit [Quit: euandreh]
ec_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 240 seconds]
euandreh has joined #commonlisp
tane has quit [Quit: Leaving]
akoana has joined #commonlisp
shka has quit [Ping timeout: 268 seconds]
tyson2 has quit [Ping timeout: 240 seconds]
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
liminality has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
johnjaye has joined #commonlisp
NicknameJohn has quit [Ping timeout: 240 seconds]
<liminality>
so how do i get good at lisp?
<Bike>
reading and practice
<alcor>
By playing around with it in a REPL
msavoritias has quit [Remote host closed the connection]
<liminality>
wheeere can i find some things to read?
<liminality>
alcor i do use common lisp a lot but like i feel like im in a bubble, y'know?
<liminality>
is there a... list of good books on CL? one that i can make my way through
<jackdaniel>
minion: tell liminality about pcl
<minion>
liminality: 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).
<ixelp>
Practical Common Lisp
<jackdaniel>
minion: tell liminality about paip
<minion>
liminality: paip: Paradigms of Artificial Intelligence Programming. More about Common Lisp than Artificial Intelligence. Now freely available at https://github.com/norvig/paip-lisp
<ixelp>
GitHub - norvig/paip-lisp: Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"
<jackdaniel>
if you want to learn ~contemporary common lisp go after PCL, if you want to be walked over some cool programs go after PAIP
<jackdaniel>
minion: tell liminality about ansicl
<minion>
Sorry, I couldn't find anything in the database for ``ansicl''.
<jackdaniel>
minion: tell liminality about ansi-cl
<minion>
Sorry, I couldn't find anything in the database for ``ansi-cl''.
<liminality>
paip yesss thank you. that ansi-cl, is that the one by paul graham?
<jackdaniel>
meh, there is also a book "ANSI Common Lisp" by Paul Graham - it is a bit on the boring side (in a good way!) - a very good learning material with excercises
<jackdaniel>
yeah
<liminality>
oh it has exercises? i thought it was just a specification of CL
<liminality>
i'll check it out!
<jackdaniel>
there is ANSI Common Lisp (the standard) and there is a book that aims at teaching ANSI Common Lisp
<jackdaniel>
(mind that while PCL and PAIP are available on the internet to read, you'll need to buy Paul Graham's book)
<liminality>
that's alright
<liminality>
i like his books
ec_ has quit [Ping timeout: 240 seconds]
<jackdaniel>
mind that all three books are excellent and eye-opening on their own term