freenode/#lisp - IRC Chatlog
Search
16:02:43
Josh_2
Whats the best resource for learning about compiler macros? I'm pretty sure there is a section in lol but I can't find it
16:08:11
heisig
Josh_2: I think I learned most of what I know by searching all Quicklisp projects for DEFINE-COMPILER-MACRO.
16:09:58
heisig
I also have some more specific rules, like "Never use &key in a compiler macro's lambda list".
16:11:44
heisig
https://lispcookbook.github.io/cl-cookbook/macros.html mentions a talk by cbaggers that also seems to explain compiler macros.
16:12:06
Gnuxie[m]
there's also this https://web.archive.org/web/20160306051951/http:/pentaside.org/paper/compilermacro-lemmens/compiler-macros-for-publication.txt
16:18:22
beach
And thanks to call-site optimization, compiler macros may soon be a thing of the past. :)
19:23:38
brandflake11
Hey all, I am having trouble with some lisp programming I am working on with Common Music. There is a function called (rhythm) that takes a symbol that represents a music rhythm (quarter-note 'q, eighth note 'e). I made a function that can parse a list and return these symbols, but rhythm doesn't like its output. I get an error "Can't parse QUOTE as a rhythm." Would anyone be willing to look at a pastebin and see where I'm going wro
19:31:35
Nilby
I would guess it would have to be like: (setq test-list '(0 e 1 s 2 q 3 e 4 q 5 s 6 t))
19:32:40
brandflake11
Nilby: The rhythm function needs the quote though. Without it, I get the error "The value e is not of type number"
19:33:17
brandflake11
The documentation for rhythm says it takes symbols, so maybe something like that?
19:34:54
brandflake11
Nilby: Oh, actually, my fault, that was the problem. I was doing something silly. Thank you Nilby!
19:45:54
brandflake11
Okay, another problem. If I do the rhythm function in a loop, like (rhythm (list-select)), I get "The value e is not of type number when binding sb-kernel::x".
19:51:47
Nilby
It's passing i to list-select which expects it to be number, and it's a symbol every alternate time. So you'd probably have to do something like (loop for (i s) in test-list ... ) so that i would only be the numbers.
19:55:02
brandflake11
Nilby: It lets you create systems that make music, instead of you having to write the notes themselves
19:58:01
Nilby
I tried it a long time ago, but I realized I'm not so good a algorithmic composing. I'm more a mindless improviser.
20:13:39
Nilby
There's quite a few people who do music with lisp/scheme, from many years back. But even a new system was created recently: OpusModus
20:14:17
brandflake11
Nilby: I've never heard of OpusModus. Do you know of any artist names that I can look up and listen to music?
20:18:29
brandflake11
That's cool, so you know someone who wrote the software? The only other lisp composer that I found so far was Andrew Sorensen, and the pieces on http://commonmusic.sourceforge.net/
20:20:25
brandflake11
Nilby: I never thought that kind of thing was super interesting, until I saw it done with lisp. That changed everything for me
20:20:49
brandflake11
Lisp just looked faster than other languages when it came to live-coding music
20:21:44
brandflake11
Totally, especially if there's also visuals. I think it would be cool to also integrate some kind of body controller that can affect the music
20:36:07
phantomics
A while back I was experimenting with using April to generate midi notes, vector languages are good for live coding thanks to the terse syntax
20:37:36
phantomics
Combine it with Slime and you can have a code file that serves as an interface, where you can C-x C-e code blocks to produce different effects
20:38:44
brandflake11
phantomics: That's what I'm doing with common music. At this point anyways, text editing with anything else but emacs is tough for me :)
20:39:58
phantomics
It's a compiler from the APL language to CL, lets you do array transformations with very little code
20:47:39
phantomics
The protocol itself is extremely simple, it takes like 30 lines of code using the lisp-binary library to create each frame
20:48:24
phantomics
Each frame is just a vector of 8-bit ints, each 3 of them setting the R G B level of each pixel
23:45:37
phoe
unrelated: I have a question about CLHS 5.2 and the code from https://plaster.tymoon.eu/view/2323#2323
23:48:00
phoe
CLHS 5.2 point 1 implies that BLOCK FOO, as an intervening exit point, should be abandoned - so RETURN-FROM FOO should not be executed
23:48:25
phoe
and yet it seems to be executed on my implementations, and :EXIT-FOO is printed/returned
23:52:29
phoe
simplified the example a bit; now it's a question of whether 24 or 42 should be returned and whether this code is conforming
23:52:48
antonv
phoe: I wanted to ask how do people workaround https://github.com/roswell/roswell/issues/463
23:53:39
antonv
Meanwhile, I found a workaround - build roswell from source during the "install" phase
23:55:39
antonv
On your question, without reading CLHS, it's strange to assume (return-from foo ...) would ignore (block foo ...)
23:59:24
specbot
Transfer of Control to an Exit Point: http://www.lispworks.com/reference/HyperSpec/Body/05_b.htm
0:02:01
antonv
Ah, I understood your question little better now. You mean (return-from test), whould abandon (block foo ...), so (return-from foo) should not work...
0:03:54
antonv
The fact that it works on some exisging impls may be justified by "The consequences are undefined if an attempt is made to transfer control to an exit point whose dynamic extent has ended."