Search
Sunday, 5th of July 2020, 21:40:56 UTC
21:47:45
phoe
What is the easiest way to define two packages that cross-reference each other via local nicknames?
22:20:13
Bike
phoe: with sbcl's interface, call add-package-local-nickname for one, i guess. gets annoying if you also want to be able to reeevaluate defpackage forms without complaint, tho
22:22:11
phoe
Bike: I got UIOP:DEFINE-PACKAGE for all my reevaluation needs
22:34:59
Lord_of_Life_
** NICK Lord_of_Life
0:14:40
aeth
phoe: Thanks for your input earlier. I fixed the two issues you spotted and I'm going to think about how to approach the typecheck soon.
0:16:22
aeth
I'm not sure if I'll do that right away or if I'll do some graphics stuff first. I haven't done any graphics in a while and I'm thinking of some simple (3D, but effectively behaving the same as isometric) tiles.
3:00:58
beach
Good morning everyone!
5:38:12
madrik
If certain keyword arguments are accepted only by one Lisp and not another, how should I write the feature conditionals?
5:42:56
ErichHyuuga
Eat my diarrhea
5:42:58
ErichHyuuga
Just ate a burger at the sleazy joint
5:43:00
ErichHyuuga
Now I gotta take a shit, get to the point
5:43:03
ErichHyuuga
Sittin' on the toilet, my ass is a blast
5:43:05
ErichHyuuga
Runnin' smelly diarrhea outta my ass
5:43:09
ErichHyuuga
No f*ckin' paper
5:43:11
ErichHyuuga
Hey baby lick my ass 'til your face turns blue
5:43:13
ErichHyuuga
You're finished rimmin' me and you want some more
5:43:15
ErichHyuuga
Ya say ya don't flush but your out the door
5:43:17
ErichHyuuga
I'm back in the...with a cup
5:43:19
ErichHyuuga
Scoop it outta the toilet 'cause you wanna slurp it up
5:43:22
ErichHyuuga
Eat my diarrhea you're chuggin' it down
5:43:24
ErichHyuuga
You're suckin' my ass and your lips are all brown
5:43:26
ErichHyuuga
Since we've gone back to the hamburger place
5:43:28
ErichHyuuga
I'm gonna stick my ass right on your face
5:43:30
ErichHyuuga
I'm gonna shit in your mouth
5:43:34
ErichHyuuga
I'm gonna shit in your face, your mouth
5:43:36
ErichHyuuga
And I wanna shit on your mother
5:43:38
ErichHyuuga
I'm gonna shit on you and your mother
5:43:42
ErichHyuuga
I gotta take a shit
5:43:43
ErichHyuuga
Gotta bottle a Ex-Lax, gonna take it
5:43:46
ErichHyuuga
I'm gonna take me a lumpy shit
5:43:47
ErichHyuuga
Gonna throw it at you, I hope I hit you
5:43:51
ErichHyuuga
I hope it splats in your face there too
5:43:52
ErichHyuuga
It's comin' out my ass all drippin' wet
5:43:53
ErichHyuuga
It's comin' out my ass all drippin' wet
5:43:54
beach
madrik: That depends a lot.
5:43:55
ErichHyuuga
I want you to suck up all of it
5:43:57
ErichHyuuga
Lick my ass and eat it too
5:43:59
ErichHyuuga
Cause diarrhea is good for you
5:44:03
ErichHyuuga
Ya eat it, eat it, eat
5:44:05
ErichHyuuga
Eat it, eat it, eat
5:44:09
ErichHyuuga
Eat my f*ckin' shit
5:44:37
beach
madrik: It depends on whether different implementations require the argument, or whether it is optional.
5:47:04
madrik
beach: E.g. CCL has a :SHARING keyword argument for WITH-OPEN-FILE, which takes one of three values.
5:47:34
madrik
Right now, I have this: #+ccl :sharing #+ccl :external
5:47:55
beach
I don't think you can do better.
5:49:06
beach
If they are the last ones, you might get away with something like (bla bla . #ccl (:sharing :external)).
5:49:23
beach
Nah, that won't work.
5:50:12
beach
It would have to be #+ccl (:sharing :external) #-ccl '()
5:50:21
beach
You get the picture. Not an improvement.
8:01:25
matzy_
can you connect mito to a remote database, like one on RDS? I tried passing :host and :port to mito:connect-toplevel but I think that's where my error is coming from
8:17:45
vms14
how can I implement the qw function of perl in lisp?
8:18:00
Harag
I am working my way through left over lambda, tyring the code of
8:18:00
Harag
(defmacro/g! nif ...) I get undefined variable g!result. Is there
8:18:00
Harag
something wrong with the code of defmacro/g! in then online version of
8:18:00
Harag
the book or am I doing something wrong?
8:18:14
vms14
I want something like (qw there are strings there)
8:18:15
Harag
eish sorry about that broken post
8:18:34
beach
vms14: It is much better if you tell people what you want it to do, rather than assuming people know Perl.
8:18:35
vms14
and being converted to ("there" "are" "strings" "there")
8:18:45
vms14
beach: I was doing that
8:19:05
beach
vms14: Well, first of all, qw can't be written as a function.
8:19:21
vms14
the thing is, if I make a macro, and convert symbols to strings, the print case won't let me have mixed case,not?
8:19:21
beach
Because functions evaluate their arguments, and you apparently don't want that.
8:19:43
vms14
I only see in *print-case* :downcase :capitalize and :upcase
8:20:00
beach
Well, if you use default reader settings, then it is already too late by the time the symbol is being read.
8:20:11
vms14
then it has to be a reader macro?
8:20:30
vms14
seems the way, thanks
8:20:52
beach
It is going to be hard to keep that syntax in a reader macro.
8:21:01
vms14
then what I should aim at?
8:21:38
beach
In my opinion, you should forget about imitating the surface syntax of a language with a surface syntax that is as different from that of Common Lisp as this one seems to be.
8:21:58
beach
Or else, if Perl syntax is what you want, then don't use READ.
8:22:08
beach
Write a parser for Perl instead.
8:22:25
vms14
I just want a function/macro that turns symbols to strings
8:22:38
beach
Oh, that one is easy.
8:22:39
vms14
but, without touching the case
8:22:46
beach
That one is easy too.
8:22:52
jackdaniel
how about (string 'foo) ;?
8:23:17
beach
vms14: symbol-name does not touch the case.
8:23:39
beach
vms14: Try (symbol-name '|aBcD|) for instance.
8:24:14
vms14
but they'll have to be between || ?
8:24:26
phoe
it's the reader itself that upcases or downcases symbols
8:24:37
phoe
so you'll need a reader macro for that
8:24:53
vms14
I'll try with a reader macro then
8:24:58
beach
phoe: But then vms14 can't easily write (qw ....).
8:24:59
vms14
also an excuse to learn
8:25:15
flip214_
vms14: It might look like #q(...)
8:25:15
vms14
but the reason is to not type "" for every string
8:25:28
phoe
beach: it's impossible to write that either way without a custom reader
8:25:31
vms14
if I have to use || it's almost the same
8:25:41
phoe
by the time macroexpansion happens all the symbols are already upcased
8:25:59
beach
vms14: I think it is a really bad idea to do what you seem to want.
8:26:07
phoe
vms14: if you need to use a reader macro it'll look like #{Hello world}
8:26:13
phoe
which is also almost the same
8:26:31
phoe
(mostly because || and "" are reader macros under the hood, too)
8:26:47
vms14
didn't know "" was a reader macro
8:27:03
phoe
hey, so are the parentheses
8:27:09
phoe
and so is the quotation mark
8:27:24
specbot
http://www.lispworks.com/reference/HyperSpec/Body/02_de.htm
8:27:25
phoe
it's really turtles all the way down, until you hit the GC
8:27:36
vms14
the quotation mark, yes, just syntax sugar for (quote)
8:27:44
flip214_
vms14: when I came over from Perl, I tried to make CL more similar to Perl, too.
8:28:02
vms14
flip214_: and what did you achieve?
8:28:05
phoe
vms14: parentheses are just syntax sugar for READ-DELIMITED-LIST
8:28:31
flip214_
After some more practice I found out that most of that stuff isn't necessary ... CL-PPCRE:SCAN is a bit longer than /../, but it gives more results back anyway
8:28:54
flip214_
so I got around to like the verbose Lisp way -- it's more readable over the long run anyway
8:28:58
vms14
I'm actually mixing perl and lisp by using sockets and perl eval XD
8:29:24
vms14
in netbsd I have some troubles, like no threads in sbcl, and most of libraries won't work
8:29:32
vms14
so perl will be the lisp libraries
8:29:51
vms14
actually using sdl from perl, and wanting to do the logic in lisp
8:31:05
flip214_
why not embrace lisp symbols, and just serialize them as strings to perl?
8:31:36
flip214_
I did a reader macro that kept case for me; then I could write §MixedCase-Symbol or §(Mixed List)
8:31:53
flip214_
I needed that for JSON serialization (right case for keys)
8:31:53
vms14
just wanted to have the qw function in lisp
8:32:16
phoe
can't do that without a reader macro
8:33:02
phoe
I assume you could do stuff like #{foo bar baz QuUx} that evaluates to ("foo" "bar" "baz" "QuUx")
8:35:17
phoe
totally doable with a reader macro then
8:38:28
beach
vms14: According to what you said, that is NOT what you want. You said you wanted to be able to write (qw ...).
8:38:49
vms14
yes, but the only way seems to be a reader macro
8:38:57
vms14
so qw{} it's kinda fine
8:39:13
vms14
and even more alike to perl
8:39:30
beach
vms14: It is mystery to me why that particular reader macro is acceptable, but (qw ".." "...") is not.
8:39:52
vms14
cause the reason is I'm lazy to put ""
8:40:22
vms14
and it's a nice excuse to learn how to make a reader macro, which always wanted to do
8:54:09
phoe
where is the bug in this code? https://plaster.tymoon.eu/view/1943#1943
8:54:27
phoe
when copypasted to a REPL, it works fine in terminal but hangs in SLIME
8:55:07
phoe
vms14: also qw{} will not work
8:55:25
phoe
QW will get interpreted as a symbol
8:56:41
vms14
but i have to learn how reader macros work
8:56:51
phoe
vms14: https://gist.github.com/chaitanyagupta/9324402
8:57:06
pve
phoe: are you sure the arguments to qw-reader should be like that? Wasn't it (stream character number)?
8:57:43
Harag
when using flatten in a macro it returns stuff like ,G!RESULT as sb-impl:comma and should I be seening that or getting G!RESULT as a a symbol?
8:57:55
phoe
Harag: see the errata for LoL
8:58:50
phoe
pve: you fixed it! thank you
8:59:18
phoe
vms14: https://plaster.tymoon.eu/view/1943#1943
8:59:44
vms14
xD I was looking that, you made it for me
9:00:26
phoe
just an exercise to ensure that I know how to write dispatch reader macros (hint: I obviously don't fully know, as you can see above)
9:00:43
phoe
feel free to read it and then try to write it yourself based on the article I posted - it's a good one
9:01:00
phoe
pve: thanks for the assist
9:22:55
vms14
phoe https://termbin.com/bf4l
9:23:14
vms14
{function string1 string2 string3...}
9:23:41
vms14
thanks phoe, I wouldn't make it if you weren't helping me
9:24:32
phoe
you don't want that last line
9:24:47
vms14
it gives me error then
9:24:51
phoe
first of all, it's an argument count mismatch, since the function must accept two arguments
9:25:06
phoe
second, it should signal an error, since a lone closing delimiter is a programmer error
9:25:20
vms14
but it fails if I put {something more}
9:25:30
vms14
only works if there is a space at the end
9:25:35
vms14
like {something more }
9:25:45
vms14
if I put the last line, it works
9:25:52
beach
Set the syntax of } to be that of )
9:25:59
phoe
yes, but not because of the reason you are thinking
9:26:04
phoe
SET-MACRO-CHARACTER will cause #\} to be a terminating macro character
9:26:23
phoe
where "terminating" means that the reader will not include it as a part of tokens
9:26:42
phoe
so (set-macro-character #\} (lambda (c s) (declare (ignore c s)) (error "Lone closing delimiter))) or what beach said
9:27:04
phoe
...more or less, I'm missing a closing doublequote
9:27:17
vms14
then something is wrong I guess
9:27:32
vms14
cause I had this error when I don't put a space at the end
9:27:51
vms14
I'll restart slime and see what it does now
9:28:01
vms14
maybe it was a mistake that I've done before
9:28:13
phoe
you most likely got that because #\} was not a terminating macro character
9:28:23
phoe
that's why it's important to set it to be a terminating macro character
9:30:00
beach
phoe: Are you sure your technique is portable?
9:30:33
phoe
beach: what do you mean?
9:30:33
beach
As I recall, in Eclector, we actually have a valid action associated with #\).
9:31:03
beach
So (again, as I recall), READ-DELIMITED-LIST doesn't actually consume the #\).
9:31:20
phoe
"If it is char, then the character is consumed and the list of objects is returned."
9:31:27
phoe
http://www.lispworks.com/documentation/HyperSpec/Body/f_rd_del.htm
9:32:32
phoe
if I understand the reader algorithm correctly, parsing the delimiter is actually the duty of the reading function
9:32:49
phoe
that's why the delimiter alone is allowed to just error if it's encountered
9:32:56
beach
Maybe so. It has been a long time since I worked on the reader.
9:32:58
phoe
and R-D-L behaves just like that
9:33:19
beach
phoe: You know a lot of Common Lisp now! Congratulations!
9:33:49
beach
That's why I would like you to work on SICL. :)
9:35:33
vms14
the sad part is now that it works, it won't serve for my original purpose xD
9:35:58
phoe
vms14: what was the original purpose
9:36:08
vms14
I have a function named modules that takes a list of arguments and makes perl load those modules
9:36:18
vms14
the sad part is modules in perl are in This::Form
9:36:31
vms14
and that makes lisp think I want to refer to a package xd
9:36:42
vms14
so I need to put "" anyways
9:36:53
vms14
but it was nice to make a reader macro and understand them a bit better
9:36:54
phoe
modify your reader macro some more
9:37:17
beach
It lets you configure the interpretation of tokens.
9:37:41
jackdaniel
or use esrap if it is only about parsing code
9:37:54
beach
It is high time to stamp out implementation-specific readers anyway.
9:37:59
vms14
then I have to change the read-delimited-list and read it manually?
9:38:41
jackdaniel
https://scymtym.github.io/esrap/
9:39:59
phoe
mostly because READ will attempt to read symbols
9:40:04
phoe
and that will badly break
Monday, 6th of July 2020, 9:40:56 UTC