freenode/#lisp - IRC Chatlog
Search
16:58:36
Younder
_rumbler31, if you are using kermit anyhow why not writer script in kermit. I don't see the need for Lisp.
17:02:07
_rumbler31
Younder: I didn't make it, and I referenced it both for looking into the cocoa apis for enumerating connected serial/usb devices, as well as using them to communicate with them from lisp in my own work, not necessarily using kermit
17:02:46
johnnybanana
that will take any number of expressions and have each be evaluated and printed in order, using the "=>" format, with semicolons separating pairs
17:04:14
johnnybanana
this is what I have so far: (defmacro macro-call (expr) `(format t "~&~S => ~S~%" ',expr ,expr))
17:05:09
_rumbler31
you can give an argument that is a list, and a few control caracters will iterate through it and use the list as the source of each iteration
17:12:24
johnnybanana
(defmacro macro-call (@body args) `(format nil "~{ => ; ~A ~}" (mapcar #'eval ,@args)))
17:13:15
Bike
With their original definition, (macro-call x) => (format t "~&~s => ~s~%" 'x x) which works fine.
17:13:37
Bike
there's no need to use eval. you don't want to use eval, both for general style reasons, and because it makes the original example impossible since eval doesn't know about lexical bindings.
17:15:56
Bike
johnnybanana: what you can do is just expand into several format calls like the one you already had. one for each form. no need for fancier format strings, and definitely no need to loop at runtime
17:21:43
johnnybanana
So this is what I have (defmacro macro-call (&rest form) `(mapcar #'(format t "~&~S => ~S~%" ',form ,form) ,@form))
17:25:21
Bike
I already gave you an example of what your expansion could look like, try aiming for that
17:30:00
_rumbler31
at runtime he wants to emit "=>" so the inner body will look like (write-string " => ; ") (form1) ...
17:45:56
phoe
Because I just realized that I'm about to reinvent wget with my custom code, and that doesn't sound good.
18:19:45
Bike
otherwise it would be kind of tricky to account for different calls returning different values and stuff.
18:22:01
phoe
Bike: wouldn't be too tricky. the multiple-value-mapcar would keep an internal counter of how many values were at most returned; every time this counter is bumped up, new dummy list(s) filled with NILs are returned.
18:30:58
skrtskrt
I am currently working on a macro where it takes a list of variables and a body of code, and ensures that the variables revert to their original values after the body of code is evaluated
18:32:02
phoe
do you mean that you store their values somewhere before the body of code, execute the code, and then set the variables to these stored values?
18:43:05
phoe
since I just realized that a MULTIPLE-VALUE-MAP{CAR,CAN,LIST,CON} would be really handy.
18:46:35
Bike
(let ((hash (make-hash-table))) (setf (gethash 'fuck hash) t (gethash 'shit hash) nil) (multiple-value-mapcar (rcurry #'gethash hash) '(fuck shit stack)) => (T NIL NIL), (T T NIL)
19:01:16
phoe
we need a minimum length of all argument lists but maximum length of all multiple-value-lists
19:02:32
_death
better to just work on lists instead of pretending that you're dealing with multiple values..
19:04:05
Bike
for the argument lists you can do (loop for l = lists then (mapcar #'cdr l) until (some #'endp l) collecting (multiple-value-list (apply function (mapcar #'first l))))
19:04:32
_death
phoe: then use multiple-value-list to get a list of the values and work on this list
19:05:18
phoe
hm, for me this means destructuring-bind + multiple-value-list + some means of collecting the results.
19:24:03
phoe
Bike: I allowed myself to blog it at https://blog.teknik.io/phoe/p/1604 - I hope you have nothing against it.
21:12:22
shka
well, to be fair even gnu cat get's updates so perhaps there is no such thing as perfect application
21:12:53
KZiemian
shka: even if there suboptimal is better that put this project longer in the state of coma
21:46:36
Younder
try one of the noisy groups like Haskell, they should be right up your alley. You are a Haskell programmer you just don't know it yet
0:54:37
Elronnd
I'm trying a to learn webdev with lisp. I looked at a few frameworks, and what I found were clack and ningle, which seemed nice and simple. But I have problems with both of them
0:55:02
Elronnd
with ningle, with this simple script, http://sprunge.us/aYTF, when I run it it says it worked and it's listening. But it's definitely not listening
0:55:37
Elronnd
with clack, there's a minimal example that says to pass it a lambda taking an env. But it doesn't tell you what things are in the 'env', so how tf do you get at the env?
1:00:01
resttime
For me: https://files.catbox.moe/6hfblv.png , maybe it's because you're running the file as a script?
1:12:45
jasom
Elronnd: If you have the time to get it setup, I strongly recommend emacs+slime+evil (evil is a vim compatibility package for emacs).
1:13:25
jasom
Elronnd: it's not urgent since slimv+vim "does the job" as you say, but slime is definitely less "meh" and more "wow"
1:16:12
resttime
The Paredit package would be a nice addition to check out as well if you're not too overwhelmed with new stuff. It helps with manipulating/balancing parenthesis.
1:18:18
resttime
I'd say learn how to configure the emacs to manage packages, get the recommended ones, and then dive in.
1:33:09
pierpa
when you launch emacs it display some useful informations, including pointers to tutorials
4:24:48
ebrasca
open-network-stream: make client process failed: Connection refused, :name, sly-1, :buffer, nil, :host, 127.0.0.1, :service, 4005, :nowait, nil