freenode/#lisp - IRC Chatlog
Search
18:52:35
osune
can somebody recommend a hassle "free" PAS like Heroku for CL ? I want to host a small chat bot for no cost but fun.
18:53:23
froggey
Ober: theoretically. I'm not sure how you'd interact with a translated library though
18:55:30
osune
Ober: does it has ready to go sbcl? There seems no maintained base "Buildapp" Template for Heroku.
18:56:10
waynecolvin
xlisp is fairly pretty easy to build on android (use make -f makefile.unix) but it isn't standard. ECL is much harder but there are binaries for arm32 you can download
18:58:43
phoe
My indentation just went crazy. My macro suddenly stopped indenting like it should and instead my macro is like https://i.imgtc.com/ni1wA3y.png
18:59:37
osune
phoe: i only know this behavior if my lisp buffer has no repl mode (or was it the other way round?)
19:01:01
phoe
(defmacro define-raptor-module (name (&rest protocol-classes) &body clauses) ...) is how it's defined.
19:11:57
k-stz
I'm reading "Lisp outside the box" and in a chapter on Memory, the author mentions "The stack is a data structure which, like the GCed heap, was originally invented for
19:11:57
k-stz
Lisp back in the 1950s.", I think that's interesting and like to back it up with some sources, but I can't find any, and for the stack I found contradicting ones
19:14:25
pjb
Also any early compilation book; they'll discuss at length about displays (storage for the frames of functions).
19:20:46
pjb
shka: Actually, it was a second generation system: LISP has been developped only because neither the FORTRAN guys nor the Algo guys accepted to add ternary IF or COND to their languages! As for the cons cells, they were invented by NSS: http://informatimago.com/articles/flpl/index.html
19:36:31
k-stz
pjb: I'll keep it in the back of my head, I might just have occasion to check out your work, but its too much for now
21:04:06
python476
ever wanted to see lisp and quantum computers ? https://www.youtube.com/watch?v=f9vRcSAneiw
22:19:37
resttime
I got CCL 1.9 working on flight hardware, I got told if packaged then it might get deployed with the satellite once it goes to space :3
22:20:53
resttime
I took a picture of testing sending a hex command to a serial device connected and it works: https://i.imgur.com/KLKm9iN.png
22:22:56
resttime
If I can get PPP running by compiling the kernel module then I might be able to get a REPL over SSH
22:29:51
pjb
Because IIRC, I had some bad bugs in 1.9, and was quite happy to upgrade to 1.10… (but it may have been MacOSX specific bugs, I don't remember).
22:30:42
resttime
I wasn't sure how, I read there would be some issues because the hardware uses soft float and that was 'abandoned' 1.10 and onwards would mess up some math functions
22:31:33
whoman
#1=with all of the (with-all-of-the-... in lisp, is there a commonly accepted practice to jump into rabbit holes ? also what is that procedure =)?
22:32:04
resttime
pjb: Yeah reading over release notes again for v1.10 and it says it https://trac.clozure.com/ccl/wiki/ReleaseNotes/1.10
22:34:02
whoman
pjb: i see a lot of lisp code using (with-...) as wrappers to create/destroy of various states or objects. is it normal that main program code is often wrapped in all of that ?
22:34:06
resttime
If I can send lisp to space and make it useful I will be satisfied (and then I will try to send my art on the satellite too hehehe)
22:34:59
pjb
resttime: of course, if you write papers and make youtube conferences, you'll be in good place next to DeepSpace 1 and its RAX software.
22:41:56
resttime
Hahaha no way, what I do is so little. I am in disbelief that I somehow ended up this kind of stuff. Like I see how stuff happened but at the same time I'm like, "waht? serisouly?"
22:48:04
whoman
pjb: ive dont a bunch of C++ so the idioms make a lot of sense to me. and now i understand.. so its quite alright to have many levels deep of main code running inside of the insides of the insides of ... ? perhaps i am touching in to some stack depth trauma, i am not smart enough to see
22:54:11
jasom
whoman: because of the possibility of non-local exits, you're going to have a lot of code of the pattern (let ((foo ...)) (unwind-protect (progn ...) (destroy foo))) the WITH- familiy of macros just allow you to not worry about all the moving parts there.
22:55:44
lisp_guest
hi everyone, could someone tell me what's wrong with this piece of code? http://rextester.com/TDO73450
22:57:32
lisp_guest
it does seem fishy to me too, but i've been thinking that the book must be right, so it's probably my fault in not understanding backquote correctly or something
22:57:48
Bike
no, the book is wrong. you're not the first person to come in here asking about defmacro/g!
22:58:09
Bike
when i say "wrong" i mean that it works on several implementations, such as ccl. but it's not conformant code.
22:58:28
whoman
jasom: ah cool, that is exactly what i was hoping =) i will read more about non-local exits later on. im still not approaching return/return-from and how that seems a bit magical
22:59:27
pjb
whoman: that said, if you have to open several files and it bothers you to have several with-open-file embedded, you can always write a macro to be able to open them all in one go. Just like LET lets you bind several variables at once.
22:59:38
Bike
"An implementation is free to interpret a backquoted form F1 as any form F2 that, when evaluated, will produce a result that is the same under equal as the result implied by the above definition, provided that the side-effect behavior of the substitute form F2 is also consistent with the description given above."
23:00:22
Bike
this means that `whatever can be read as anything. it can incorporate things like vectors and structs that flatten doesn't know about.
23:00:38
pjb
jasom: it's probably not a stand alone expression. Check where it occurs, and see if there's a ` around it.
23:01:04
whoman
Shinmera: why would someone with ego problems have good code? is what i am thinking.
23:01:44
lisp_guest
Bike: hmm, so would that be the reason why one of the symbols is literally ",g!three" instead of "g!three" as i would expect?
23:01:52
Shinmera
Well, I mean, some people have a good justification for saying their stuff is good. Because it is actually good.
23:02:00
Bike
lisp_guest: that said, your code is wrong in another way, and i don't know if it's from the book
23:02:19
pjb
lisp_guest: The bug is on the second line of: (defmacro/g! test-macro (x y) `(let ((,g!three 3)) (print (1 2 ,g!three))))
23:02:30
Bike
lisp_guest: first you call syms-in, which sort of flattens a form, then you call g!-sym-p on each item
23:03:01
Bike
lisp_guest: so, if your form has a 3 in it, your thing tries to do (symbol-name 3), which is wrong
23:04:14
Bike
pjb: the intent of this is that g!three will be bound at macroexpansion time to a gensym
23:04:23
pjb
Well, the other bug is in (print (1 2 ,g!three)) since 1 is not the name of a function!
23:06:01
Bike
(defmacro foo (thing) (struct-read thing)) is ok. rare, but ok, and implementations do this kind of thing sometimes.
23:06:40
pjb
well if g!three is bound to a variable name, then it should be (print (list 1 2 ,g!three))
23:06:53
jasom
wait, this happens before the body is macroexpanded, so it shouldn't be an issue there, right? i.e. it's not the generic code-walker problem
23:07:48
Bike
so in the unmacroexpanded code, there's a literal struct. and in that struct, there's something that will be a form later
23:07:57
pjb
but syms-in is buggy, it should be: (defun syms-in (&rest body) (remove-if-not (functiokn symbolp) (remove-duplicates (flatten body))))
23:08:24
jasom
Bike: the rest of the standard readtable is pretty well defined, right? quasiquotation is the only issue
23:09:25
Bike
(defstruct foo form) (defmacro unfoo (thing) (foo-form thing)) now have code like (unfoo #.(make-foo :form 'g!three))
23:09:35
lisp_guest
pjb: i've fixed g!-sym-p according to what bike said, i.e. moving the check for symbolp before using (symbol-name s)
23:10:26
jasom
Bike: I'm missing how (foo-form thing) can have a *read-time* expansion of a non-list
23:10:44
lisp_guest
Bike: so using what you quoted from clhs, where exactly is the part that's wrong?
23:11:05
Bike
the part that's wrong is the assumption that lisp code is entirely contained in list structure
23:11:23
jasom
oh, I see what you're saying. It's not non-conformant, it just requires that the body be a list.
23:11:47
pjb
So yes, the code in "Let Over Lambda" is pedagogical! You have to find the bugs in it… :-)
23:12:33
Bike
especially since the problem being solved is being too lazy to use with-gensyms explicitly :/
23:12:52
jasom
LoL shows it in use with quasi-quote, which is absolutely wrong; the rest becomes more of a style question
23:13:43
jasom
as long as LoL is approached as a fun exercise it's fine. It shouldn't be used as a library of useful macros
23:14:03
Bike
and that representation can include code outside of list structure, that is the obvious problem, yes.
23:14:26
jasom
lisp_guest: yes. There are similar issues e.g. for pattern matching. The solution there is to use a known quasiquote implementation (e.g. fare-quasiquote)
23:15:03
lisp_guest
right, that's what i meant, but the formulation was kinda weird (for me at least)
23:16:08
lisp_guest
i've read the clhs page multiple times but didn't connect the fact that flatten only works on lists and that "any other form F2" might contain non-lists
23:16:35
Bike
i don't think any implementation did choose to expand into non-lists, before sbcl switched to that uh... a year ago?
23:18:34
Bike
anyway, like i said, you're not the first newbie to come in here asking about this. it's most of what i've heard of LoL, so my opinion isn't great, but on the other hand i haven't heard any OTHER problems with it, so just be cautious i guess
23:18:59
pjb
lisp_guest: depends on what you mean by "walking over". The expansions should contain only functions, macros and standard special operators, so a code walker should be able to interpret it correctly.
23:19:33
lisp_guest
another question, in the body of defmacro/g!, inside the first quasiquote, when ,@body is spliced into the list
23:19:36
pjb
The only problem to code walkers are implementation specific special operators (not covered by a macro expanding to non implementation specific special operators).
23:22:34
lisp_guest
the relevant definition from clhs i see about ,@body is "[,@form] is interpreted as form"
23:22:55
lisp_guest
"form" here is my "body", but "body" itself is a list of something that uses quasiquote
23:42:23
jasom
lisp_guest: quasiquote is expanded by the reader, and are expanded as soon as it is read
23:43:28
jasom
lisp_guest: if you have a quasiquote inside a quasiquote, recurse down to the inner quasiquote
23:44:16
lisp_guest
jasom: right, so in this example http://rextester.com/TDO73450 (ignore the mentioned bugs), when ,@body is used to splice another list, i.e. the list "body"
23:44:44
lisp_guest
this list "body" was constructed by capturing the body of "test-macro" which itself had a quasiquote
23:45:34
jasom
lisp_guest: yes quasiquote is expanded at *read* time, long before macros ever get into it
23:47:46
lisp_guest
right, so i'd have to use some other implementation that doesn't use these internal representations for quasiquote
23:48:21
jasom
I should say, it is expanded to some unknown FORM that when evaluated will generate something equivalent to what the hyperspec says
23:48:37
lisp_guest
being aware that the internal representation of quasiquote is impl-specific makes it clearer now a bit
23:50:40
jasom
lisp_guest: the spec even mentions that implementations may do this for making printing prettier
23:51:25
lisp_guest
jasom: ya, i've read that paragraph multiple times but couldn't think of an example where it might affect me
23:56:04
jasom
https://gitlab.common-lisp.net/frideau/fare-quasiquote <-- readme here also talks a lot about quasiquotation
0:00:24
Bike
"n conformance with the CLHS, fare-quasiquote expands its patterns at read-time ... If you enable feature #+quasiquote-at-macro-expansion-time, fare-quasiquote will expands its patterns at macro-expansion time, using the same convention as Scheme, with symbols quasiquote, unquote, unquote-splicing and unquote-nsplicing" huh?
3:31:44
aeth
What video is that? There's no title bot in here and I don't trust YouTube links. (Although it probably is safe or else |3b| would have commented.)
3:32:03
aeth
Oh, it's this one, don't even need to click, it matches the URL on the front of HN. https://news.ycombinator.com/item?id=15880172
3:39:37
vtomole
From around 43 minutes in that video he talks about what the interns thought of Lisp.