freenode/#lisp - IRC Chatlog
Search
14:12:23
TMA
is there an "almost standard" way to represent map/dictionary/hashtable literals? (almost standard means widely accepted as for example asdf, cffi, bordeaux-threads, cl-ppcre or hunchentoot)
19:37:22
fiveop
(defclass my-op (asdf:non-propagating-operation) ()) (defmethod asdf:perform ((o my-op) c) (print c)) (asdf:operate 'my-op :alexandria) => no output
19:43:53
fiveop
I expect at least 'perform ((o my-op) (c system))' to be called, and thus a representation of the system alexandria to be printed.
19:46:23
jackdaniel
your snippet prints here #<system "alexandraia"> and returns two values, operation and a plan
19:50:53
fiveop
That helped, I must have messed something up (eventually, it told me there is no package asdf)
20:10:00
fiveop
deriving from asdf:downward-operation I got where I wanted: perform called for my-op on all dependencies of the system
20:10:23
fiveop
(asdf:clear-system :alexandria) allowed me to run the op multiple times with full effects
21:38:33
mfiano
(serapeum:dict :a 1 :b 2 :c (serapeum:dict :a 10 :b 20 :c 30)) (serapeum:href * :c :b) ; => 20
21:46:41
aeth
I use the word "hash" for literal hash-tables, which matches Racket's API iirc. So e.g. (hash :foo 42)
21:48:03
aeth
If you don't want to pull in a massive utility library, it's very tiny, and it could even be done in 3 lines if you wanted to do it in a more straightforward but less reliable way: https://gitlab.com/zombie-raptor/zombie-raptor/blob/754bbc15bab6486d58e1ce848ba2782f78ca5e83/util/util.lisp#L559-577