freenode/#lisp - IRC Chatlog
Search
13:12:39
beach
Since many people here hang out neither in #sicl nor in #clim, let me just encourage anyone who regularly uses an inspector during development to try the new version of Clouseau. I am currently using its extension API in order to inspect SICL bootstrapping objects, something that was not possible with the old Clouseau. The new version is a total rewrite (by scymtym) and I thing he did a fantastic job.
13:30:24
yoeljacobsen
beach - I couldn't find much info on Clouseau - may you please provide more information on how to try it?
13:37:52
edgar-rft
yoeljacobsen: don't thank me too early, the link leads to a ten year old version :-(
13:38:48
scymtym
i updated the wiki page to link to the current source (i.e. https://github.com/McCLIM/McCLIM/tree/master/Apps/Clouseau ). the documentation is here: https://common-lisp.net/project/mcclim/static/manual/mcclim.html#Inspector
14:13:47
asdf_asdf_asdf
Hello folks, hello there, hello all, hello wholes, hello You. Hi, hey, hello!
16:51:15
vms14
there is no directive in format to print the current number of iterations inside a list?
16:53:53
White_Flame
isn't there a format escape that will evaluate a form? can you shove an INCF in there?
16:59:08
pfdietz
In which I discover both Optima and Trivia can take exponential time to compile a pattern.
17:03:07
pjb
vms14: (format nil "~2,1@/fmt-index/~:*~{~,/fmt-index/~:* ~(~A~)~^~%~}." '("rule 1" "rule 2")) #| --> "1 rule 1 ; 2 rule 2." |#
17:05:23
White_Flame
an easier-to-write but less memory efficient version would be to map* up a list of data with calculated counters in it, then pass that to FORMAT
17:05:43
dlowe
(loop for e in list as i from 0 do (format t "~a. ~a~%" i e)) seems more than reasonable
17:06:46
pjb
Remember that the control string is an argument to format. It can come from a configuration file or a localization file.
17:08:17
vms14
but it's an interesting case and a good example to learn how to create functions for format
17:40:48
White_Flame
one of the more interesting output construction facilities I've seen is in Erlang
17:41:12
vms14
and I thought it could be a good exercise for a noob like me to create a lisp version of this script
17:41:21
White_Flame
you build up nested lists of strings (or byte values), and then the final output call loops through, flattening all the output into the stream
18:52:39
aeth
the only problem with format is that there isn't a (standard) deformat for parsing so you could (stream "~F" variable) and get a variable out
20:07:51
pjb
aeth: format is quite complex, with ~{ an ~/; it would be difficult to write a symetric scan function.
21:24:10
Bike
So writing (code-lambda-list (+ 3 2) (format t "oh")) is equivalent to writing (list (lambda () (+ 3 2)) (lambda () (format t "oh")))?
21:24:37
Bike
That's what you need to convey in your example and think about when you're writing a macro. The expansion.
21:25:42
Bike
Don't think in terms of backquoting, think in terms of inputs and outputs. You're just constructing a form.
21:33:09
Bike
(defmacro code-lambda-list (&rest forms) `(list ,@(loop for form in forms collect `(lambda () ,form)))) is how i'd write it. no ,@ of the forms.
21:45:14
Bike
(defmacro code-lambda-list (&rest forms) (cons 'list (loop for form in forms collect (list lambda () form)))) works too.
21:45:47
vms14
(dolist (oh (list "oh" "my" "cat")) (push `(lambda () ,oh)) flist) why this isn't working
21:46:31
Bike
I get an error like "Too few arguments supplied to a macro or a destructuring-bind form", don't you?
21:48:30
Bike
(defmacro code-lambda-list (&rest forms) (cons 'list (let ((elems nil)) (dolist (form forms (nreverse elems)) (push (list 'lambda () form) elems)))))
22:01:03
vms14
I have a function that associates options with functions and calls a function depending on the option the user chooses
22:03:18
vms14
now I can just (show-menu '("option1" "option2") (code-lambda-list (print "option1") (print "option2")))
22:36:21
teeeay
might be the wrong place to ask, but does anyone here have any experience with the vecto library for common-lisp?