molson has quit [Remote host closed the connection]
<hashfunc569>
pjb: is this a bug in SBCL?
<hashfunc569>
that's what i'm using
<pjb>
Not really. It's implementation defined. But sbcl is an exception amongst CL implementations about backquote.
<hashfunc569>
pjb: dang. do you know of a work-around for this situation?
<pjb>
Well, it could be argued that sbcl is non-conforming there, since after all, ` is a reader macros, so you could expect that it reads as something else than QUASIQUOTE. But then, ' is a reader macro that reads as QUOTE, so why not.
<hashfunc569>
maybe if i read them in as non-pretty?
<hashfunc569>
i'll try that
<pjb>
hashfunc569: to render your code conforming, you just have to change your expectation. Namely, the result obtained is good as long as you don't expect anything specific. list* quote list nil list x or quasiquote list ,x whatever. You'll get some expression and that's all you can expect.
<hashfunc569>
pjb: that's not my end-goal for this tho
azimut has quit [Ping timeout: 240 seconds]
<hashfunc569>
i need to be able to READ-FROM-STRING the resulting atom
<pjb>
what atom?
molson has joined #commonlisp
<hashfunc569>
and (read-from-string ",BODY") renders an error
<_death>
you can bind *print-pretty* to nil.. but in general, not every Lisp object is readable..
molson has joined #commonlisp
skyl4rk has joined #commonlisp
lisp123 has joined #commonlisp
Catie has quit [Quit: heading home]
lisp123 has quit [Ping timeout: 250 seconds]
<hashfunc569>
_death: so binding *print-pretty* to nil works! but... i can't print out the object... (print #S(COMMA :EXPR X :KIND 0)) => "COMMA is not a defined structure type."
<hashfunc569>
_death: i don't understand how i can't read nor print #S(COMMA :EXPR X :KIND 0) . is there a way to read/print #S(COMMA :EXPR X :KIND 0)
knusbaum has joined #commonlisp
<_death>
well, you are using ~A (aesthetic) to print to standard output.. in this case it strips off the package qualifier
<_death>
(in a manner of speaking.. it just prints the symbol name, not actually stripping something off)
eddof13 has joined #commonlisp
Bike has quit [Quit: Lost terminal]
<hashfunc569>
wow, for the longest time i thought ~S, meant format to a string
morganw has quit [Remote host closed the connection]
Guest74 has quit [Quit: Connection closed]
<_death>
Lots of Interesting Surprises Provided
<pjb>
hashfunc569: then use ~S, not ~A
<pjb>
as you discovered.
razetime has joined #commonlisp
<pjb>
hashfunc569: also, when using read-from-string, you can use prin1-to-string to generate the strings you will be reading.
Psybur has quit [Remote host closed the connection]
s-liao has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Quit: Leaving...]
razetime has quit [Ping timeout: 256 seconds]
Guest74 has joined #commonlisp
Inline__ has joined #commonlisp
Inline has quit [Ping timeout: 250 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
s-liao has quit [Ping timeout: 256 seconds]
razetime has joined #commonlisp
s-liao has joined #commonlisp
<hashfunc569>
how is this form erroneous: (DEFMACRO MAC (X . NIL) (SB-INT:QUASIQUOTE (LIST ,X . NIL) . NIL) . NIL)
<hashfunc569>
but, this form is not erroneous: (DEFMACRO MAC (X . NIL) `(LIST ,X . NIL) . NIL)
Everything has joined #commonlisp
<neominimum>
Can a function have multiple designators? e.g. package1::foo points to the same function as package2::bar
<neominimum>
*points to/names
<neominimum>
wait, couldn't I do something like setf the symbol-function to the function object?
Everything has left #commonlisp [#commonlisp]
ec has quit [Ping timeout: 240 seconds]
ec has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
<neominimum>
hashfunc569: I'm curious about all the `. NIL`'s what is that for?
s-liao has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<neominimum>
I mean, I understand it is dot notation for building lists, but why are you writing code using explicit dot notation.
<neominimum>
simply curiosity?
vats has joined #commonlisp
paul0 has quit [Quit: Leaving]
mfiano has quit [Quit: WeeChat 3.4.1]
razetime has quit [Ping timeout: 252 seconds]
<hashfunc569>
neominimum: it's just what i'm generating
<hashfunc569>
i'm mapping over all of the atoms in a form
<hashfunc569>
and that's what i get
<hashfunc569>
i don't care that it looks that way right now, i just want to get it to work
<beach>
Good morning everyone!
s-liao has quit [Ping timeout: 256 seconds]
<beach>
neominimum: Yes, a single function can have an arbitrary number of names. But remember that a function name is not necessarily a symbol. I recommend you use FDEFINITION rather than symbol-FUNCTION.
<beach>
hashfunc569: What is it in your program that doesn't work?
<beach>
hashfunc569: Or rather, what did you expect it to do that it doesn't?
aeth_ has joined #commonlisp
aeth has quit [Killed (NickServ (GHOST command used by aeth_))]
aeth_ is now known as aeth
<neominimum>
hashfunc569: Ah, okay :)
<neominimum>
beach: Thanks, I'll check out FDEFINITION
<beach>
You may consider SYMBOL-FUNCTION as deprecated.
semz_ has joined #commonlisp
semz has quit [Ping timeout: 250 seconds]
semz_ is now known as semz
razetime has joined #commonlisp
<neominimum>
beach: Oh right, because a function designator can also be a list like '(setf foo) and SYMBOL-FUNCTION only takes a symbol.
<beach>
Exactly. It is not a "function designator" though. It is just a "function name". Check the glossary.
<neominimum>
Ah, okay
<beach>
Interestingly, "function designator" does not include names such as (SETF <symbol>). For that you need an "extended function designator".
<neominimum>
I wonder why the spec makes that distinction.
waleee has quit [Ping timeout: 256 seconds]
akoana has quit [Quit: leaving]
<beach>
You would have to ask a member of X3J13.
<neominimum>
Issue 174 - FUNCTION-NAME seems to have some information regarding the definitions.
<neominimum>
to refer to functions as both symbols and lists
<hashfunc569>
beach: in this form: https://pastebin.com/nWBnDFL9, i would expect the , to be separated from the symbol BODY, but instead they are one in the same. i'm wondering what i need to do in order separate them
<hashfunc569>
*sorry, from the symbol X
<beach>
It is not standardized what the reader does with ` and , so you can't expect that.
<beach>
It so happens that SBCL wraps the form that follows the , in a struct instance.
<beach>
Some implementations may wrap it in something like (UNQUOTE X) which is not an atom, but SBCL wraps it in a struct instance which *is* an atom.
<hashfunc569>
ok, so what i'm trying to do is map over all atoms in a form. it works perfectly fine, but when i come across the "atom" ,BODY (or something of the likes thereof) i get the error "Comma not inside a backquote." and it's really screwing up my program
<beach>
That's different.
<beach>
You are trying to read from a string that contains something like ",X".
<beach>
That in itself won't work, because the reader must see both the ` and the , in one invocation of READ. Otherwise, if it sees only a , in such an invocation, it will signal an error.
<hashfunc569>
yes, and i expected that the atoms would be separated into: UNQUOTE X
<beach>
What makes you expect that? There is nothing in the standard that supports that expectation.
<beach>
Plus, as I said, you can't read just ",X".
<hashfunc569>
i guess i just presupposed that ` and , were syntatic sugar for atoms
<hashfunc569>
themselves
<hashfunc569>
so dang, my program is really screwed then isn't it
<beach>
Again, you have two separate and unrelated problems.
<hashfunc569>
i understand that i can't just read ",X". but instead i wish they separated into UNQUOTE and X
<beach>
It is separated.
<hashfunc569>
not in a simple way from what i'm seeing
<beach>
It is just that SBCL separates them by wrapping the X in a structure instance which is an atom.
<beach>
It has nothing to do with simple or not.
<beach>
Other implementations may wrap the X in a list, which is *not* an atom.
<beach>
And which one the implementation does is not standardized.
<hashfunc569>
if i set *print-pretty* to nil, i clearly see this structure, but i can't even print it nor read it. so it is not simple
<beach>
So, in summary, you can not count on your implementation to make ,X wrap the X in a list.
<beach>
There is no definition of "simple" in the standard that supports your claim.
<hashfunc569>
this is a bug in SBCL in my opinion
<beach>
It is not. But it is an unusual choice they made.
<beach>
Presumably to make it easier to print forms like that as ,X.
<hashfunc569>
in my test program, if i set *print-pretty* to T i get this output: (DEFMACRO MAC (X . NIL) (SB-INT:QUASIQUOTE (LIST #S(SB-IMPL::COMMA :EXPR X :KIND 0) . NIL) . NIL) . NIL)
<beach>
Again, it is not standardized what the reader does with ` and ,
<hashfunc569>
this DOES evaluate without an error
<hashfunc569>
however
<hashfunc569>
if i set *print-pretty* to nil
<hashfunc569>
i get this output: (DEFMACRO MAC (X . NIL) (SB-INT:QUASIQUOTE (LIST ,X . NIL) . NIL) . NIL)
<hashfunc569>
and that IS an error
<beach>
Are you sure it's not the other way around?
<hashfunc569>
i'm using SBCL
<hashfunc569>
you can test both forms to see for yourself
<beach>
I know. I am asking about *print-pretty* being T or NIL.
<beach>
If you were to report a bug, what would your report say?
<hashfunc569>
sorry, yes
<hashfunc569>
it's the other way around
<hashfunc569>
but the point still holds
<hashfunc569>
that the fact of setting *pretty-print* to NIL or T shouldn't effect the outcome of a program
<beach>
Then what purpose would that variable serve?
<hashfunc569>
in my case, if it's T the program is an error. however, if it's NIL the program works fine
<beach>
So your bug report would say something like "I want my program to work and it doesn't, so that's a bug in SBCL"?
<hashfunc569>
is that not erroneous behavior, though? a program should work the same regardless if *pretty-print* is set to nil or t. i feel like that is indisputable
<beach>
What makes you think that any program that reads the output being printed with *print-pretty* T should work if it works with *print-pretty* NIL?
<beach>
There is nothing in the standard that guarantees that.
<hashfunc569>
beach: in understand your reasoning
<hashfunc569>
*i understand your reasoning
<hashfunc569>
i'll just have to find a way to work around it
<hashfunc569>
i guess a better question is: is there an optin to fully expand reader macros before they are read?
<hashfunc569>
btw, beach, thanks for the feedback
<beach>
Sure.
<beach>
You can use a different reader, like Eclector.
<hashfunc569>
dang. i was hoping that there was something non-external
<beach>
What you want to do amounts to re-implementing the reader anyway, so you might as well use one that exists, is documented, and is configurable.
<hashfunc569>
the work-around i was thinking is going along the lines of: save atom as a string -> restore atom and unstringify it
<pjb>
hashfunc569: you've not understood the difference between ~A and ~S, between princ and prin1 and between ,X and \,X !!! Try: (DEFMACRO MAC (X . NIL) (SB-INT:QUASIQUOTE (LIST \,X . NIL) . NIL) . NIL)
hashfunc569 has quit [Ping timeout: 256 seconds]
kpoeck has joined #commonlisp
razetime has quit [Ping timeout: 256 seconds]
mon_aaraj has quit [Ping timeout: 252 seconds]
mon_aaraj has joined #commonlisp
razetime has joined #commonlisp
lisp123 has joined #commonlisp
razetime has quit [Ping timeout: 240 seconds]
kpoeck has quit [Quit: Client closed]
razetime has joined #commonlisp
Oddity has quit [Ping timeout: 250 seconds]
kpoeck has joined #commonlisp
Oddity has joined #commonlisp
vats has quit [Remote host closed the connection]
lisp123 has quit [Remote host closed the connection]
nulluint has joined #commonlisp
beach has quit [Quit: ERC (IRC client for Emacs 26.3)]
bhyde[m] has quit [Quit: You have been kicked for being idle]
kpoeck has quit [Quit: Client closed]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
<_death>
an alternative to implementing/using a new reader is to implement/use new backquote/comma reader macros.. then you can make sure `(,x) translates to something like (my-backquote (#S(my-comma :expr x :kind 0))) or whatever, assuming the code doesn't has its own reader macros.. check out a library called fare-quasiquote
<_death>
*have
lisp123 has joined #commonlisp
<pjb>
_death: unfortunately. hashfunc569 as left.
<_death>
I see
<pjb>
+h
rgherdt has joined #commonlisp
Inline__ has quit [Remote host closed the connection]
Inline has joined #commonlisp
frgo has quit []
mon_aaraj has quit [Ping timeout: 256 seconds]
mingus has quit [Ping timeout: 240 seconds]
mingus has joined #commonlisp
mon_aaraj has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
s-liao has quit [Ping timeout: 256 seconds]
cosimone has joined #commonlisp
Oddity has quit [Ping timeout: 256 seconds]
heisig has joined #commonlisp
<heisig>
For those attending ELS in person, there will be a social event tomorrow (20.3.) at 12:30 at https://www.openstreetmap.org/#map=19/41.1379/-8.61277 (Largo de Miguel Bombarda). The plan is to have lunch together.
heisig has quit [Ping timeout: 252 seconds]
heisig has joined #commonlisp
s-liao has joined #commonlisp
aeth_ has joined #commonlisp
aeth has quit [Killed (NickServ (GHOST command used by aeth_))]
aeth_ is now known as aeth
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
heisig has quit [Quit: Leaving]
razetime has quit [Ping timeout: 240 seconds]
s-liao has quit [Ping timeout: 256 seconds]
razetime has joined #commonlisp
s-liao has joined #commonlisp
<neominimum>
I'll put $5 on 'hashfunc726' for tomorrow please.
mingus has quit [Ping timeout: 240 seconds]
random-nick has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
mingus has joined #commonlisp
mingus_ has joined #commonlisp
s-liao has joined #commonlisp
mingus has quit [Quit: leaving]
mingus_ has quit [Quit: leaving]
frgo has joined #commonlisp
tyson2 has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
s-liao has quit [Ping timeout: 256 seconds]
karlosz has joined #commonlisp
hhdave has quit [Ping timeout: 240 seconds]
vats has joined #commonlisp
wacki has joined #commonlisp
orestarod has joined #commonlisp
Dynom has joined #commonlisp
<ck_>
I usually hash everything to :red or :black, makes the functions easier to implement
Bike has joined #commonlisp
lisp123 has joined #commonlisp
karlosz has quit [Quit: karlosz]
s-liao has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
mfiano has joined #commonlisp
mfiano has quit [Client Quit]
mon_aaraj has quit [Ping timeout: 252 seconds]
hhdave has joined #commonlisp
trumae_ has joined #commonlisp
mfiano has joined #commonlisp
Inline has quit [Quit: Leaving]
mfiano has quit [Client Quit]
mfiano has joined #commonlisp
orestarod has quit [Quit: Leaving]
vats has quit [Ping timeout: 240 seconds]
orestarod has joined #commonlisp
MajorBiscuit has joined #commonlisp
MajorBiscuit has quit [Client Quit]
Inline has joined #commonlisp
waleee has joined #commonlisp
MajorBiscuit has joined #commonlisp
mfiano has quit [Quit: WeeChat 3.4.1]
mfiano has joined #commonlisp
trumae_ has quit [Quit: leaving]
razetime has quit [Ping timeout: 240 seconds]
s-liao has quit [Quit: Client closed]
MajorBiscuit has quit [Quit: WeeChat 3.4]
trumae has joined #commonlisp
Major_Biscuit has joined #commonlisp
Major_Biscuit has quit [Client Quit]
Major_Biscuit has joined #commonlisp
Bike has quit [Quit: Connection closed]
mfiano has quit [Quit: WeeChat 3.4.1]
mfiano has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
razetime has joined #commonlisp
mon_aaraj has joined #commonlisp
trumae has quit [Quit: Quit]
trumae has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
Bike has joined #commonlisp
kpoeck has joined #commonlisp
mingus has joined #commonlisp
trumae has quit [Quit: Quit]
trumae has joined #commonlisp
kevingal has joined #commonlisp
<drbluefall>
Okay, for some reason `cl-unicode` is just refusing to load. It keeps complaining about a symbol named `*standard-optimize-settings*` in `cl-ppcre` not being present. Checking the sources by hand, though, proves that not to be the case.
<drbluefall>
I have legitimately no clue why it isn't finding it.
mon_aaraj has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
mfiano has quit [Quit: WeeChat 3.4.1]
ldb has joined #commonlisp
<drbluefall>
What's even *more* nonsense is that when I quickload `cl-unicode` in a repl.it instance, it works fine.
ferminmf has joined #commonlisp
<ferminmf>
Hello!
<froggey>
Hi Fermin!
<ferminmf>
Porto seems quite nice, quite vertical tho
mingus has quit [Ping timeout: 250 seconds]
ferminmf has quit [Quit: Client closed]
razetime has quit [Ping timeout: 252 seconds]
cage has joined #commonlisp
razetime has joined #commonlisp
kpoeck has quit [Quit: Client closed]
mfiano has joined #commonlisp
X-Scale` has joined #commonlisp
mon_aaraj has quit [Ping timeout: 250 seconds]
X-Scale has quit [Ping timeout: 272 seconds]
X-Scale` is now known as X-Scale
mon_aaraj has joined #commonlisp
mingus has joined #commonlisp
mingus has quit [Client Quit]
mingus has joined #commonlisp
aeth has quit [Ping timeout: 240 seconds]
tane has joined #commonlisp
tane has quit [Changing host]
tane has joined #commonlisp
aeth has joined #commonlisp
mingus has quit [Quit: leaving]
trumae has quit [Read error: Connection reset by peer]
trumae has joined #commonlisp
trumae has quit [Read error: Connection reset by peer]
trumae has joined #commonlisp
mfiano has quit [Quit: WeeChat 3.4.1]
mfiano has joined #commonlisp
Bike has quit [Quit: Connection closed]
kpoeck has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
ldb has quit [Quit: ERC (IRC client for Emacs 27.2)]