libera/#commonlisp - IRC Chatlog
Search
16:17:42
McParen
hello, does anybody know if there is a function that works like pairlis but produces a plist instead of an alist?
16:18:35
McParen
pairlis intertwines (a b c) and (1 2 3) to ((a . 1)(b . 2)(c . 3)) but I'd like to get (a 1 b 2 c 3).
16:19:00
beach
You can do that easily yourself: (loop for e1 in l1 for e2 in l2 collect e1 collect e2)
16:19:41
McParen
beach, thanks, I've already found out how to do this myself, I am wondering if that is available somewhere as a "standard" function i cant seem to find.
16:24:47
McParen
i was wondering how it was "forgotten" in the standard to provide an alist version but not a plist version.
16:28:28
yitzi
I doubt it was forgotten. PAIRLIS is kind of extraneous in my opinion. If you aren't concatenating an existing alist then it is just MAPCAN with CONS.
16:35:08
phoe
(mapcan #'cons (list (cons 1 2) (cons 3 4)) (list (cons 5 6) (cons 7 8))) produces weird results, as expected of something that forcibly alters CDRs
16:35:38
phoe
no worries, I actually had to stop for a moment and think of what would MAPCAN do with improper lists
16:37:03
yitzi
I am generally of the impression that alists are older and that plists were added later. Initially associated with symbol plists first then disconnected in CL. Anybody attest to that?
16:52:44
yitzi
Looks like plists were added then http://www-formal.stanford.edu/jmc/history/lisp/node4.html
16:55:36
McParen
I grew to like plists more than alists since I realized that you can do (apply #'make-instance 'my-object plist).
17:01:18
_death
it also had a PROP function like (cdr (member ...)) and a REMPROP that assumed a plist structure
17:04:27
_death
lisp 1 also has a simplifier and a differentiator for algebraic expressions.. where did those go? :)