freenode/#lisp - IRC Chatlog
Search
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.
6:53:52
Hiver
I found this (https://gist.github.com/endofinnsmouth/009a7a3a91b180371fea20cc983898ed) online, and it said it was an "nlp". What is that, and can you explain this program?
6:56:37
Hiver
just so i know what not to do though. what is bad about that code? I dont wanna fuck up. ooooooooooh and thanks
6:58:21
jackdaniel
line breaks are bad, it is not clear what functions do (not docstrings or comments)
7:03:27
Zhivago
That's just general advice -- but it also applies regarding people who can't spell "can't".
7:03:53
beach
Hiver: It uses SETQ to define special variable, but that is undefined behavior. And it does not use earmuffs on special variables, which is bad style.
7:08:08
jackdaniel
no, style is just a strong indicator it is not worth reading. program doesn't look useful either
7:12:05
Zhivago
They're trying to get intelligent people to ignore them so that they can focus on the stupid ones.
7:13:40
Zhivago
No. They just get the intelligent people to decide that the message is obviously a scam so that they then don't respond, which would waste the scammers' time.
7:15:01
Hiver
ooooh. ok. so, he wont come here because he is afraid of the advice? or is the program a scam?
7:15:09
Zhivago
The same process applies to software. Intelligent people avoid using software that looks like it was written by a twelve-year old who had been dropped frequently on its head as a child.
7:16:02
Zhivago
Which is generally a good idea, because software that looks like that probably hasn't been written carefully or well thought out, and the cost of maintaining it is high.
7:17:24
Zhivago
One problem is that to beginners, they are so bad at reading code that they can't distinguish between good code and bad code.
7:20:17
minion
Hiver: direct your attention towards pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
7:22:41
Hiver
Also to respond to beach. He used to do a bit of Java (idk if it is true). Recently switched to LisP
7:22:59
beach
Hiver: Your friend should also learn to use an editor that can handle Common Lisp code so as to obtain correct indentation.
7:27:19
turkja
lol, why so harsh? it for sure looks like someone's first lisp program.. but it's a start anyways :)
7:38:25
vtomole
One of these days I'm going to have enough money to go to that Bay Area Lisp meet up and ELS.
7:44:51
jackdaniel
then you'll be able to say proudly at ELS: I'm here, because I've solved bunch of McCLIM problems
7:54:12
pjb
defvar and defparameter are top-level forms, you would never use them to set a variable. Use setf for that!
11:01:08
lisp_guest
i have a question about style. in this function (from yesterday) https://plaster.tymoon.eu/view/685#685
11:01:27
lisp_guest
this when bothers me a bit, because the usual way i would implement this is to have a check for the opposite and then just return early before proceeding
11:06:42
jackdaniel
I'm working on semaphores for BT (will try to merge it upstream if possible) – this is generic implementation (using cv): https://plaster.tymoon.eu/view/686#686 -- fallback for implementations which doesn't have semaphores
11:07:03
jackdaniel
I'd appreciate comment on this (for instance if I got it right) if someone have a slice of time
11:07:09
Shinmera
Especially since the return-from increases mental overhead by requiring the explicit function name, having an inverted check, and introducing an explicit control flow transfer.
11:08:26
Shinmera
jackdaniel: In fact, having a list is awful because it means you don't get a distinct type for the semaphore.
11:09:04
jackdaniel
because I would have to check somehow, if implementation has semaphores implemented "its way"
11:10:05
Shinmera
The implementation potentially providing its own semaphore object doesn't really change anything.
11:10:05
jackdaniel
there is bt:timeout type defined without such conditionalization, but SBCL with-timeout signals different condition – this is a source of many programmer errors
11:10:31
jackdaniel
I want to avoid such situation for semaphores, that programmer does check-type on bt:sempahore
11:10:32
Shinmera
jackdaniel: Make the struct named %foo and provide a deftype that aliases to the concrete type on each impl
11:11:25
Shinmera
I really don't think that any amount of implementation overhead is going to justify using a list
11:12:43
jackdaniel
I've explained initial motivation for such avoidance, I may reconsider (or change upon maintainer request)
11:13:55
loke
jackdaniel: if so, you could make it three-elemtn array instead? That'll make lookups fast.