<pjb>
aeth: but I find easier to write interpreters, by writing a byte-code compiler and interpreting the byte code…
<pjb>
interpreting the source is crazy.
<aeth>
yes
<aeth>
Most interpreters are afaik either a register machine or a stack machine with bytecode as the thing that's interpreted.
<pjb>
It was an optimization on memory starved computers, and even, usually keywords were "byte-coded" anyways.
ayuce has joined #lisp
jeosol has joined #lisp
<_death>
I see "interpreter" in a very wide sense.. it is a program that takes an input :)
<aeth>
pjb: Even if you did source interpreting you could probably still do ahead-of-time macros by seeing macros as defining new primitives, I guess.
hsaziz has joined #lisp
pilne has joined #lisp
<theseb>
aeth: yes many macros are just sugar to generate lisp code automagically....the more interesting thing to me is that macros can make it appear you are giving lisp new abilities
<aeth>
infix macros are an example of that
<aeth>
(infix 1 + 1)
MerlinTheWizard has quit [Ping timeout: 260 seconds]
<aeth>
theseb: not quite, since my infix macro allows arbitrary length as long as they are the same operator (no attempt to teach it precedence) so you would necessarily have to cons up a list for that, either with &rest so you can do (infix 1 + 1 + 1) or with the syntax (infix '(1 + 1 + 1))
<aeth>
whereas the macro itself would just turn it into (+ 1 1 1) with no need to funcall/apply/whatever +
<theseb>
ok....thanks.
<theseb>
must be brain now
theseb has quit [Quit: Leaving]
<aeth>
and iirc it's also recursive so (infix 1 + 1 + (2 * 3)) is possible.
Kevslinger has quit [Quit: Connection closed for inactivity]
torbo has quit [Remote host closed the connection]
ayuce has quit [Remote host closed the connection]
heeh has joined #lisp
jruiz has joined #lisp
bitmapper has quit [Ping timeout: 246 seconds]
tessier has joined #lisp
tessier has quit [Changing host]
tessier has joined #lisp
EvW has quit [Ping timeout: 240 seconds]
lemoinem has quit [Ping timeout: 260 seconds]
lemoinem has joined #lisp
Inline has quit [Ping timeout: 272 seconds]
asarch has joined #lisp
renzhi_ has joined #lisp
<asarch>
If (defparameter *values* '((food (pizza . 3) (beer . 5) (tacos . 8)))), the I can get the value of beers with: (cdr (assoc 'beer (cdr (car *values*))))
CrazyPython has joined #lisp
<asarch>
But, what if (defparameter *values* '(("food" ("pizza" . "3") ("beer" . "5") ("tacos" . "8")))), how could I get that value?
westerns has quit [Quit: Connection closed for inactivity]
<beach>
aeth: There is a case where LET can not be turned into a function form with a lambda expression as its operator. For example (let ((&rest 234)) (+ rest 345)) is not the same as ((lambda (&rest) (+ rest 345)) 234)
<beach>
aeth: And there are cases where it might be tough to inline the function, for example when there is an environment capture, like (let ((x 234)) (lambda (y) (+ x y)))
<beach>
aeth: I recommend you read up on how Common Lisp is compiled and how the run-time environment is represented.
pjb has quit [Ping timeout: 265 seconds]
stepnem_ has joined #lisp
moon-child has joined #lisp
stepnem has quit [Ping timeout: 256 seconds]
karayan has quit [Ping timeout: 260 seconds]
Codaraxis has quit [Remote host closed the connection]
Codaraxis has joined #lisp
parjanya has joined #lisp
parjanya has quit [Remote host closed the connection]
parjanya has joined #lisp
KDr22 has joined #lisp
KDr21 has quit [Ping timeout: 246 seconds]
MerlinTheWizard has joined #lisp
EvW1 has joined #lisp
westerns has joined #lisp
parjanya has left #lisp ["Using Circe, the loveliest of all IRC clients"]
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
gabiruh has quit [Ping timeout: 256 seconds]
jruiz has joined #lisp
pjb has joined #lisp
ArthurStrong has quit [Quit: leaving]
jruiz has quit [Ping timeout: 246 seconds]
jruiz has joined #lisp
shifty has joined #lisp
MerlinTheWizard has quit [Ping timeout: 260 seconds]
ayuce has joined #lisp
MerlinTheWizard has joined #lisp
renzhi_ has quit [Ping timeout: 240 seconds]
EvW1 has quit [Ping timeout: 260 seconds]
Oladon has joined #lisp
Codaraxis has quit [Remote host closed the connection]
Codaraxis has joined #lisp
gabiruh has joined #lisp
hsaziz has joined #lisp
hsaziz has quit [Client Quit]
vivit has quit [Quit: WeeChat 1.9.1]
ayuce has quit [Remote host closed the connection]
jruiz has quit [Ping timeout: 264 seconds]
gabiruh has quit [Ping timeout: 260 seconds]
Necktwi has joined #lisp
Bike has quit [Quit: Lost terminal]
gabiruh has joined #lisp
slyrus__ has joined #lisp
MerlinTheWizard has quit [Ping timeout: 260 seconds]
slyrus_ has quit [Ping timeout: 258 seconds]
pjb has quit [Ping timeout: 265 seconds]
MerlinTheWizard has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
hsaziz has joined #lisp
karayan has joined #lisp
karayan has quit [Read error: Connection reset by peer]
<asarch>
If I have: (let ((text "Lorem ipsum dolor sit amet, consectetur\nadipiscing elit, sed do eiusmod tempor\nincididunt ut labore et\ndolore magnaaliqua.")) ...), how could I remove all the '\n' from the string?
<markasoftware>
well i guess it depends on if they are literal "\n" or an actual newline
<phoe>
asarch: "\n" only has length 1
<phoe>
(length "\n") ;=> 1
<phoe>
you will want to escape the backslashes if you want to have actual backslashes in your strings
<phoe>
that is a source of bugs in Lisp strings
<phoe>
so, "Lorem ipsum\\ndolor sit amet\\nconsectetur ..."
<phoe>
markasoftware: remove doesn't work for multi-character sequences
<markasoftware>
Is there any reason to distinguish between functions and lists as datatypes, apart from performance? I.e, you could have a lisp where a function is just whenever you put a list, which represents a function body, at the beginning of a list?
<phoe>
markasoftware: what do you mean, functions and lists as datatypes
<asarch>
The code actually is for remove the '\r' of the end of the line
<phoe>
they're distinct types, and a function isn't really a datatype
<phoe>
asarch: ooh, clrf conversion
<asarch>
Where is that function?
<phoe>
asarch: which function?
<asarch>
clrf
<phoe>
uhhh, did I mention there is such a function
<asarch>
D'oh!
<asarch>
Sorry
<asarch>
The text inserted into the model has that end of line: '\r'
<phoe>
yes, that's Windows injecting its poison
<phoe>
also s/clrf/crlf/
Oladon has quit [Quit: Leaving.]
<asarch>
I just want to remove them before insert them
Fare has quit [Ping timeout: 256 seconds]
<no-defun-allowed>
markasoftware: Closures would require functions to carry around information other than their lambda forms.
<asarch>
Can I use cl-ppcre:regex-replace-all for that?
<phoe>
well then, replace all occurrences of (string #\Return) with ""
<phoe>
yes
<asarch>
Ok
<asarch>
Thank you very much once again :-)
<beach>
markasoftware: What would you put in a list to represent a function?
<markasoftware>
it's body, though no-defun-allowed makes a good point about closures
<beach>
OK.
<markasoftware>
and idk about lambda list either
<phoe>
but then you just have a list of symbols, lists, and everything
<phoe>
it's not code, you can't really execute it
<markasoftware>
the interpreter can execute it
karlosz has quit [Quit: karlosz]
<markasoftware>
because at some point it's going to just be built-in functions
karlosz has joined #lisp
<beach>
markasoftware: In a language like Common Lisp with closures, a function needs to be represedetn by two items: code and a static environment.
<phoe>
but there's either overhead associated with compilation or overhead associated with interpreting that form
<beach>
markasoftware: Closure conversion turns nested functions into global functions represented as such a pair.
karayan has quit [Read error: Connection reset by peer]
<phoe>
neither will be faster than calling a pre-compiled function
<markasoftware>
yeah i agree, i understand the performance reasons for making functions their own format
<phoe>
also, if you simply splice function bodies inside, you will have trouble figuring out what is code and what is data
<phoe>
the distinction between (+ x y) and '(+ x y) is clear because of quoting
<beach>
markasoftware: But as long as you have those two components, the code part can be anything. For example, in SICL bootstrapping the code part is basically an instruction graph (HIR) that is interpreted by a HIR interpreter.
ahungry has quit [Ping timeout: 260 seconds]
karayan has joined #lisp
karayan has quit [Read error: Connection reset by peer]
kamid has quit [Quit: WeeChat 2.7.1]
karayan has joined #lisp
<aeth>
beach: yes, that &rest is the same as _death's example of &key afaik
<beach>
Oh, I missed that. Sorry.
<aeth>
beach: your second example is a new point, though
<aeth>
I think the implementation would have to special case that, or accept a slight performance loss there
MerlinTheWizard has quit [Ping timeout: 260 seconds]
vlatkoB has joined #lisp
<aeth>
beach: I think the first example can be resolved by having a %lambda that doesn't recognize &rest, &key, &optional, &aux, etc., since we're talking about implementations implementing CL and they can cheat like that, but I'm not sure that would be worth it
<beach>
There is no special case. You "just" do an "escape analysis" to see whether there is a chance that the environment may be captured.
bacterio has quit [Ping timeout: 260 seconds]
karayan has quit [Read error: Connection reset by peer]
karayan has quit [Read error: Connection reset by peer]
karayan has joined #lisp
<beach>
aeth: If you make LET a special case, then you are either going to miss out on inlining other functions (subject to capture), or you are going to have duplicate code; one instance for LET and another on for other functions.
<beach>
In the latter case, you have a maintenance problem.
<beach>
In the former case, you have a performance problem.
<phoe>
it is nice to learn that Common Lisp has five ARITHMETIC-ERROR subtypes to account for five IEEE floating point exception types
karayan has quit [Ping timeout: 240 seconds]
<beach>
aeth: One main trick in compiler design is to reduce special constructs to some general problem, provided of course that you then have a way of handling the general problem. An example is looping constructs. If you handle them specially, you are going to miss out on someone writing a loop using TAGBODY. So the trick here is to discover loops in the intermediate code, no matter the origin in source code, and then process those loops
<beach>
with some general technique.
karayan has joined #lisp
<beach>
In this case, discovering loops in intermediate code is one of many techniques in "control-flow analysis" which is part of compiler design.
karayan has quit [Read error: Connection reset by peer]
karayan has joined #lisp
<asarch>
It seems that CL-DBI is actually inserting the '\r' into the model
<beach>
asarch: As people pointed out, C escapes like \r and \n don't mean the same thing in Common Lisp.
<asarch>
I mean, the #\r character
<beach>
asarch: Then that's just the character r, with no backslash.
<asarch>
"READ error during COMPILE-FILE: radix missing in #R"
<beach>
asarch: And if so, you do not want to remove it.
<phoe>
asarch: wait, what
<phoe>
what file are you trying to read
<asarch>
(replace #r *text*)
<beach>
asarch: Because you would remove all the r characters.
<phoe>
asarch: #r is invalid syntax
<beach>
asarch: Try to understand what you are being told.
<asarch>
Lorem ipsum dolor sit amet,\r
<asarch>
consectetur adipiscing elit,\r
<beach>
asarch: That is not Common Lisp syntax, or if it is, there is no backslash nor a return in that string.
<asarch>
Etc. All the \r at the end of lines
<beach>
asarch: STOP IT.
karayan has quit [Ping timeout: 272 seconds]
<beach>
asarch: There is no such thing as \r in Common Lisp strings.
<asarch>
Wow!
<phoe>
beach: "Lorem ipsum dolor sit amet,\\r"
<beach>
asarch: I mean, there could be a backslash followed by the letter r.
<phoe>
I understand that this is what asarch is getting
<saturn2>
asarch: you want #\Return
<beach>
asarch: But then that is two letters.
karayan has joined #lisp
<beach>
asarch: So do you have #\Return characters in your string, or do you have backslashes, or just `r's?
<phoe>
asarch: could you paste some of the REPL input/output that shows the strings being printed?
<phoe>
use a pastebin for that
<asarch>
The text data comes from a <textarea> HTML element that sends its data through a POST method to the controller, then the controller parses all the data passed and with datafly inserts that value into a PostgreSQL clúster
<beach>
asarch: When you did your (LET ((text "...\r")) ..., you did not get any #\Return in your string.
<beach>
asarch: So then your example with LET was bogus.
<beach>
asarch: Because that was not how the string was constructed.
<phoe>
beach: please let me try handling that one
<beach>
If you like. I am getting quite impatient with asarch.
<asarch>
Yeah, my mistake. I should use \r instead of \n
<asarch>
Since the autor didn't give a real example
<phoe>
without the debugger, you get no information about local variables in a function or even the condition being signaled
<phoe>
asarch: haha
<phoe>
sounds like a case for my upcoming book
<asarch>
You are my man, phoe! Count on me with your new book
<phoe>
asarch: you might want to read chapter 16 of Common Lisp Recipes
<asarch>
I will
<phoe>
it contains information about how to use the slime debugger
<asarch>
I found a terrible bug of the REPL part of Slime
<asarch>
If you move the cursor to a previous line and then press enter to use that line as the enter of the REPL, sometimes "forget" pieces of code specially when there are lots of )'s at the end of the expression
v3ga has joined #lisp
shka_ has joined #lisp
pjb has joined #lisp
doomlist3 has joined #lisp
<doomlist3>
(format *query-io* "~a: " prompt) , (format *var* "~a " "data") here *var* shows it's no bound?
<phoe>
not really terrible, but a bug
<phoe>
doomlist3: what's *var*?
<phoe>
why do you put it in the FORMAT call where you are supposed to put the stream that you want to print to?
<beach>
doomlist3: There is no such thing as a "special Lisp word".
<phoe>
*query-io* is a standard Lisp variable whose value is a stream
<phoe>
what is *q*?
<asarch>
In México the time is: sáb may 2 02:23:46 CDT 2020
<asarch>
Too morning in the morning
<phoe>
asarch: thanks, that's really informative.
<asarch>
D'oh! Wrong channel
<asarch>
Sorry
<phoe>
(:
<asarch>
(sb-ext:bed-time)
<asarch>
Thank you guys!
<asarch>
Thank you very much!
<asarch>
Have a nice day :-)
asarch has quit [Quit: Leaving]
<phoe>
sleep well
<doomlist3>
(format *query-io* "~a: " 1) can i print the value of *query-io*
<phoe>
sure you can
<phoe>
(format t "~S" *query-io*)
<phoe>
or even (print *query-io*)
<phoe>
or just enter *query-io* in your REPL, it'll print it for you
<doomlist3>
#<JUPYTER::STDIN-STREAM {100353B7B3}>
<phoe>
yep, seems right
doomlist3 has quit [Quit: not part but quit]
* phoe
finishes the first sketch of the condition system reference, whew
doomlist3 has joined #lisp
MerlinTheWizard has quit [Ping timeout: 244 seconds]
pjb has quit [Ping timeout: 240 seconds]
_whitelogger has joined #lisp
nika has joined #lisp
decent-username has joined #lisp
<jeosol>
phoe: how's the write up coming. Did you get enough volunteers for review?
dddddd has joined #lisp
pjb has joined #lisp
drewc has quit [Ping timeout: 256 seconds]
rgherdt has joined #lisp
<phoe>
jeosol: yes, I got a few reviewers. Another thing is that some more eyes on it will never hurt.
shifty has quit [Ping timeout: 246 seconds]
<jeosol>
So you need additional eyes?
<jeosol>
Maybe I can help in some part. What's your timeline?
<phoe>
Yes; now that the most obvious typos have been found, I will want some review of the general flow of the book and the content.
<phoe>
No deadlines so far.
<jeosol>
I see, higher level review work. cool.
<jeosol>
ok, I can volunteer some time. Is there some background material, e.g., what's the assumed programming proficiency of the reader, etc.
* phoe
jumps to query with jeosol.
<jeosol>
I tried to cheat by copying an SBCL corefile from one linux machine to another to save on start time ... hmmm
<phoe>
it will work
<phoe>
as long as the executable is also the same
<jeosol>
identical OS, everything but it complained
<jeosol>
openSuSe, said something about core was built for runtime "localhost ..." but this is "second machine name" ...
<jeosol>
phoe: I just saved the image with executable set to nil. That only works for executable?
drewc has joined #lisp
pve has joined #lisp
<phoe>
jeosol: I have no idea
<jeosol>
phoe: no worries. I'll just run it overnight. I'll sort that later.
duncan_ has joined #lisp
Bourne has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
Necktwi has quit [Ping timeout: 272 seconds]
<doomlist3>
(read-line *query-io*) outs the *query-io* in string form but print and format show #<JUPYTER::STDIN-STREAM {10036D2EE3}>
<doomlist3>
I want to see what I type not some code
<phoe>
doomlist3: you're printing the stream object itself
<phoe>
you likely want to (print (read-line *query-io*)), not (print *query-io*)
<doomlist3>
I want to see query-io without reading
<doomlist3>
read-line manages to output it in string format
<beach>
How do you expect to check the contents of a stream without reading from it?
sugarwren has joined #lisp
<beach>
doomlist3: The very nature of a stream is that you can't tell what it provides until you read from it.
<beach>
doomlist3: Put differently, the operations provided on an object of type stream are operations such as reading/writing a character or a byte, perhaps peeking one item, and a few more operations, but that's it.
<phoe>
doomlist3: what do you mean, want to see *query-io* without reading
<phoe>
*query-io* is a stream, you don't know what it is inside it until you read from it
<phoe>
read-line reads stuff, that's why you see what was actually read
<doomlist3>
read-line accepts MY input, but I don't want that.
marcoxa has joined #lisp
<marcoxa>
Hello CL Hive Mind. I have a question for you.
<beach>
doomlist3: READ-LINE did not output the string "song". FORMAT did.
<no-defun-allowed>
What do you want it to read, if not your input?
<beach>
doomlist3: And *query-io* is a variable whose value is a stream, not the string "song".
<doomlist3>
but when i format I get not "song" but (format t "~S" *query-io*) --> #<JUPYTER::STDIN-STREAM {1003B112A3}>
<no-defun-allowed>
If I give it to my friend Alex here, should it only accept her input?
<doomlist3>
I want to decode {1003B112A3} to print "song"
<phoe>
> Since *query-io* = "song"
<phoe>
this is false
<beach>
doomlist3: Yes, *query-io* is a stream, that is printed exactly that way.
<phoe>
*query-io* is NOT "song".
<phoe>
that's why the rest of your paste doesn't make sense.
<phoe>
marcoxa: what's up?
<phoe>
doomlist3: please move your questions to #clschool
<marcoxa>
I want to READ a "form" which may contain "errors" (read: errors that variuos implementations signal in a very annoying "implementation dependent" way; sometimes by raising a READER-ERROR, sometimes signaling a I-DONT-CARE-ABOUT-YOU-THIS-IS-THE-ERROR-I-FU$&*NG-WANTH-TO-SIGNAL).
<beach>
doomlist3: You need to understand the basics of Common Lisp before you attack something as complicated as the project you are working on.
<phoe>
marcoxa: what's the example of such a form?
<marcoxa>
Suppose you READ-FROM-STRING something like "(this is a (oooops::list))"
pjb has quit [Ping timeout: 265 seconds]
<phoe>
marcoxa: the only thing you can do is set *read-suppress*; if package OOOOPS doesn't exist, you cannot reference a symbol from that package
<phoe>
or use #+ and #- that use *read-suppress* themselves
<marcoxa>
Most readers will keep the pointer right after the "oooops". I want to rolla back at the beginning of the form.
<marcoxa>
*READ-SUPPRESS*. Good suggestion. Let me try it.
<marcoxa>
Be back soon.
<phoe>
marcoxa: beginning of the form? oh wait a second
<phoe>
that's non-trivial
<phoe>
*read-suppress* will silently skip over invalid forms
<phoe>
it won't "undo the reading"
<phoe>
meaning, all the read characters will be gone from the stream
<phoe>
(let ((*read-suppress* t)) (read-from-string "(this is a (oooops::list))")) ;=> NIL, 26
<marcoxa>
Yep. Just checked. *READ-SUPPRESS* won't do it.
<phoe>
marcoxa: let me ask another question: why do you want to do it?
<marcoxa>
Because the work-around meeses things up otherwise. It works, but it is kludgy.
<phoe>
work-around for *what* though?
<marcoxa>
Here is the code. It is already kludgy because of the imp-dep error signaling behavior of vairous implementations.
<marcoxa>
I guess there is no incatation to force an implmentation do what I want, lest use a re-implmentation of READ.
<phoe>
marcoxa: it's impossible in general, since the Lisp reader, in the general case, doesn't know when an expression is complete until it finishes reading that expression.
<phoe>
and reading an expression can signal an error anywhere in its middle.
<phoe>
So in case of a reader error you can't show the full expression to the user because you don't have the full expression.
<phoe>
I'll ask again: why are you trying to do that though?
<phoe>
I'm asking because you seem to be solving a problem that might have a solution at another level
<marcoxa>
I know. My problem is somehow to ensure that the next form I am READing is marked as "inside" my original call to the READ-FORM function I posted.
dddddd has quit [Ping timeout: 256 seconds]
<marcoxa>
What I am trying to do is read a form at a time skipping over package errors.
<beach>
Maybe Eclector can be used for that.
<beach>
It can be configured in various ways.
<marcoxa>
I don't want dependencies. Pure CL solution please.
<phoe>
beach has a concrete solution for that, a custom Lisp reader named Eclector, but I'll be boring; why skip over package errors?
<no-defun-allowed>
Sure, just write your own reader then.
<marcoxa>
So Eclector is a drop in READer?
<phoe>
more or less, yes; you can use the read functions it provides in place of the standard ones.
<marcoxa>
Because I want to read sources even if I do not have all the package in memory.
EvW has joined #lisp
<marcoxa>
Let me look at Eclector.
<beach>
Eclector is perfect for that kind of stuff.
<beach>
We use it to read the code of an editor buffer.
<beach>
phoe: Nowadays, it is more scymtym who has the solution. :)
<phoe>
(:
<phoe>
marcoxa: I'm curious, why are you trying to read it? Are you attempting some source manipulation or statistics or caching over that source code?
<MichaelRaskin>
†µ
<phoe>
beach: I just realized that Eclector could be a good tool for these people from Google who presented their work on ELS. The one about indexing Lisp source.
<phoe>
MichaelRaskin: §ú
<beach>
phoe: I guess that's true.
<MichaelRaskin>
Well, they would still have the macro pain
<phoe>
MichaelRaskin: yes, but one pain at a time
<beach>
Eclector has turned out to be a great abstraction for plenty of stuff. I came up with the idea, but scymtym has taken it way beyond my initial vision.
<phoe>
macroexpanding can come later.
<beach>
Maybe they need first-class global environments too. :)
<MichaelRaskin>
I dunno, generally any solution for macroexpanding I can imagine, will be fine with standard read (then process and eval)
<MichaelRaskin>
Now global environments, that would probably be very helpful
<marcoxa>
phoe I am doing source documentation.
<phoe>
marcoxa: ...that's exactly what jgodbout is doing
<phoe>
you seem to be solving the same problem as them
<marcoxa>
That's what I have been doing for years.
McParen has joined #lisp
<marcoxa>
Ok. Looks like Eclector may be able to do the job. I'd like a more direct solution, but that's ok.
<phoe>
Eclector will then also preserve things for you that get lost during standard READ: indentation, comments, symbol casing, whitespace, et cetera.
<phoe>
you'll want to have these if you work with Lisp source code
Fare has joined #lisp
<marcoxa>
My needs for the specifica case are not all that sophisticated. It looks like Eclector restart machinery will do. I will put adding it in my queue.
<marcoxa>
Thanks for the pointer.
<marcoxa>
Ok. My English is messed up this morning. I meant: I will add to my queue the integration of Eclector in my code.
<beach>
marcoxa: Good luck.
<beach>
marcoxa: If you need help with Eclector, scymtym is the best one to ask.
<marcoxa>
Will do.
hsaziz has quit [Ping timeout: 264 seconds]
karlosz has quit [Quit: karlosz]
EvW has quit [Ping timeout: 240 seconds]
jmarciano has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
random-nick has joined #lisp
ealfonso has quit [Ping timeout: 240 seconds]
eta has quit [Quit: Gateway shutdown]
eta has joined #lisp
Bike has joined #lisp
rozenglass has joined #lisp
Fare has quit [Ping timeout: 256 seconds]
lxbarbosa has joined #lisp
EvW has joined #lisp
jonatack_ has joined #lisp
jonatack has quit [Ping timeout: 272 seconds]
fourier has joined #lisp
pjb has joined #lisp
thijso has quit [Quit: leaving]
thijso has joined #lisp
jmarciano has quit [Read error: Connection reset by peer]
malm has quit [Quit: Bye bye]
malm has joined #lisp
scymtym__ has quit [Ping timeout: 246 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
ggole has joined #lisp
scymtym has joined #lisp
doomlist3 has quit [Ping timeout: 260 seconds]
<scymtym>
marcoxa: if you plan to heavily use Eclector's error recovery, you have to use the master branch of the github repository since i pushed the (hopefully) final changes to that functionality just three days ago
vap1 has joined #lisp
pjb has quit [Ping timeout: 240 seconds]
mrcom has quit [Read error: Connection reset by peer]
vaporatorius has quit [Ping timeout: 265 seconds]
malm has quit [Quit: Bye bye]
malm has joined #lisp
PuercoPop has quit [Ping timeout: 265 seconds]
jonatack_ has quit [Ping timeout: 260 seconds]
sth_ has quit [Ping timeout: 265 seconds]
aeth has quit [Ping timeout: 265 seconds]
Tordek has quit [Ping timeout: 265 seconds]
jonatack_ has joined #lisp
aeth has joined #lisp
Tordek has joined #lisp
sth_ has joined #lisp
jason_m has joined #lisp
EvW has quit [Ping timeout: 260 seconds]
pjb has joined #lisp
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
<phoe>
minion: memo for Fare: done, added a subsubchapter to the book that you mentioned. Please review it to verify that I haven't made some bugs along the way; thanks.
<minion>
Remembered. I'll tell Fare when he/she/it next speaks.
mrcom has joined #lisp
whythat has joined #lisp
fourier has quit [Ping timeout: 240 seconds]
easye` has quit [Quit: ERC (IRC client for Emacs 26.3)]
easye has joined #lisp
souron-the-evile has joined #lisp
souron-the-evile has quit [Quit: Leaving]
whiteline_ has joined #lisp
whiteline has quit [Read error: Connection reset by peer]
rozenglass has quit [Quit: WeeChat 2.3]
rozenglass has joined #lisp
luni has joined #lisp
<boeg>
Yesterday I believe it was phoe who told me to not use T -typespec in handle-case - its a code smell, be specific instead, IIRC. Good point, by now my question is; how do I go about making sure my handle-case handles all the signals a function could signal? I mean, I could look at the direct function I'm calling and see what it might signal, but other than that, maybe it calls something that calls something that might signal
<boeg>
something
<boeg>
that might bubble up?
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<_death>
if you want to handle all conditions (for example, to have a thread terminate if an error bubbles to the top instead of breaking into the debugger) then indeed it's appropriate.. that is an exception to the rule
Nilby has joined #lisp
<_death>
if you want to perform some action, such as logging.. then T (all condition types) may be too general.. I use ERROR for that
ayuce has joined #lisp
shifty has joined #lisp
<boeg>
I guess - my intuition would be, that one might specify the types that one is aware of, and then also include a catch all if the "end game" is, in my specific case, when the things I'm not specifically handling is signaled, the appropriate response would be to log it and throw a http 500 error
<scymtym>
SERIOUS-CONDITION is another possibility. memory-related conditions are SERIOUS-CONDITIONs but not ERRORs in some implementations
<_death>
note that T includes WARNINGs, for example..
<boeg>
right, so error would be better suited I guess in my case as the "catch all" because I only want to catch errors I'm not handling and throw a 500
<_death>
scymtym: right, so logging during memory exhaustion may not work well
<_death>
if you reserve the memory prior to that, or free some memory, it makes sense
akoana has left #lisp ["Leaving"]
<scymtym>
_death: right, it certainly gets complicated. for example handling with HANDLER-CASE may have freed stack already. (handler-case (labels ((rec (x) (1+ (rec x) ))) (rec 1)) (serious-condition (c) (princ c))) has a chance of working
<Nilby>
I've used catching CONDITION (or effectively T) in a web console, so it can be appropriate for something that is effectively a REPL. But as soon as you run it under another REPL, you probably don't want that.
<_death>
boeg: just recently I had a bug like that, where I started threads for background processing and didn't have a catch-all, my server.. when things stopped working and I connected to swank I saw some 200 threads waiting in the debugger..
<_death>
boeg: with Lisp you have to avoid expectations like "on error the thread will terminate"
<boeg>
good points!
<boeg>
_death: indeed - i'm trying to learn about this all condition system, it's very different
<phoe>
boeg: the answer already happened there, handling SERIOUS-CONDITION should do the trick.
<phoe>
You should explicitly allow non-serious-conditions to be unhandled, since these may be signaled as a part of standard program operation.
<_death>
btw it's always a good idea to name your threads ;)
whiteline_ has quit [Remote host closed the connection]
<boeg>
phoe: makes sense, i'm just trying to figure out what the library i'm using is treating as a, say, SERIOUS-CONDITION. Like failing while persisting something - I want that to return a 500 error, not throw the program into the debugger
<boeg>
however the documentation of SERIOUS-CONDITION sounds like its what i need
whiteline_ has joined #lisp
whiteline_ has quit [Remote host closed the connection]
<boeg>
yeah, they inherit from error which inherits from serious-condition, so i believe that is the answer
whiteline_ has joined #lisp
luni has quit [Quit: Leaving]
<phoe>
serious conditions = errors + other non-error serious conditions, such as storage-conditions
doomlist3 has joined #lisp
<boeg>
indeed
<phoe>
basically, if a condition requires either handling or interactive intervention, it should be a serious condition
<phoe>
so that's what you should be handling in your handle-all
<boeg>
yes, seems so
<_death>
they should've made all non-serious conditions flippant-conditions
rwcom3 has quit [Quit: Ping timeout (120 seconds)]
<phoe>
yes
rwcom3 has joined #lisp
<boeg>
can I in slime go to the definition, or get shown the definition in some other way, of the symbol under the cursor? There's e.g. slime-inspect-definition, but it doesn't show me the actual code, and its also the function definition i'm currently inside, not the symbol under the cursor that it inspects
<phoe>
boeg: M-.
<shka_>
or slime-edit-definitions
<boeg>
do you know the name of the function? I'm using evil-mode
<boeg>
thanks
<shka_>
there is also slime-edit-uses
<shka_>
*slime-edit-definition
<shka_>
singular form
<boeg>
ah, its under "g d" in evil - awesome! "Go to Definition", easy!
<boeg>
:P
<shka_>
good
red-dot has joined #lisp
stoneglass has joined #lisp
<boeg>
is using let* a code smell? I believe it says so in On Lisp, but I'm sometimes in situations where I think it makes sense - does that indicate my code is not written in the proper way that common lisp code should be written, or is Paul Graham just being a little to harsh on let* and it does indeed have some applications?
<beach>
LET* is fine.
<phoe>
it's not a code smell, PG is harsh
<boeg>
alright, good to know, thanks
<beach>
I often use it to name intermediate results, which makes the code easier to understand.
xkapastel has joined #lisp
<phoe>
it makes perfect sense when you have code that would otherwise be written as (foo (bar (baz (quux (frob (fred x)) :test :yes)) t) (cons 1 2))
<boeg>
yes, intermediate results is exactly where I find use for it too
<phoe>
it makes sense to instead (let ((frobbed-fred (frob (fred x))) (bazzed (baz frobbed-fred :test :yes)) ...) ...)
<boeg>
either you end what your example, phoe, or with nested let's
<phoe>
this also allows debugging on high DEBUG settings because you have intermediate variables.
<boeg>
or you can use let*
<Nilby>
If let* is a code smell, then all the most impressive lisp software stinks.
<phoe>
there are some people who instead try to bind as few variables as they can; I consider that a very good golfing sport that should not intersect with code that is meant to be read, understood, and fixed
<splittist>
or even something like ~>
<boeg>
phoe: yeah, thats what I've found too - intermediate results makes a lot of things easier
whythat has quit [Ping timeout: 240 seconds]
<splittist>
(actually, that's sort of the opposite of let*, so ignore me)
ayuce has left #lisp ["ERC (IRC client for Emacs 28.0.50)"]
* shka_
likes ~>
<shka_>
pipe is love
<splittist>
shka_: it certainly encourages one to return useful results (:
<phoe>
~> is an alternative to LET*
<phoe>
mostly because it allows sane threading and splitting computation into meaningful steps, rather than having one heavily nested list
<phoe>
it's like having let*, except the temporary variables are anonymous
<shka_>
yes!
<boeg>
well, i guess i have to look up ~> now ...
<_death>
PG's style is more functional, and in that style LET* is a code smell.. another reason is that, as you say, it is often used to name intermediate results.. it may be that you could factor your code differently, say by defining small functions (that have conceptual value) instead of having the computation done in-line with LET*
<phoe>
boeg: it's a so-called arrow macro
<phoe>
(ql:system-apropos "arrow")
<boeg>
does it have a name in the hyperspec?
<phoe>
ha! it's non-standard
<boeg>
oh
<boeg>
alright
<phoe>
in general, arrow macros are lovely, but I'll still prefer my temporary variables
<_death>
the arrow macros, in addition to encouraging in-line computations like LET*, also remove the need to name the intermediate results, thus further discouraging thinking about small functions to factor the code
<phoe>
;; and thus make debugging harder
* boeg
ughm, the buzz-kills
<boeg>
lmao
<phoe>
but that's a smaller issue if your code is functional enough, since pure functions can be much more easily tested
<_death>
the nest macro removes useful visual hints about structure
<shka_>
cl-ds offers sort of structured pipes akin to C♯
<shka_>
and it blends really nicely with ~>
<phoe>
_death: yes, but I found that article to be a good introduction to threading macros in general
<_death>
in my opinion, such macros are a crutch for people who can't keep up with Lispy style of design, which is sometimes taxing in thinking
* splittist
resolves to stay off _death's lawn
<phoe>
_death: do note that the lispy style of design is "invent and/or use whatever language features you consider the best for your current problem domain"
<phoe>
and I can say that threading macros kind of fulfill this style
<_death>
so instead of decomposing your problem, you keep your computations in-line with LET*, oh but names are hard, so you use an arrow.. since you handle multiple concerns in a function body, it becomes complex, and instead of decomposing it you turn to NEST so that it "looks better"
<MichaelRaskin>
Decomposing things that just do not make sense on their own is also bad
<_death>
that's why it can be taxing.. you need to decompose it in a way that has conceptual value
<MichaelRaskin>
It's a myth
<MichaelRaskin>
There is a lot of business logic that just makes sense together.
<MichaelRaskin>
Not everything is fully general, and «sorry Mario, the logic you are looking for is happenning somewhere else» is also not always a pleasant experience
<_death>
yes, abstraction has a cost.. what I'm saying is that these operators are often used as a crutch, and code using them can be much improved
<MichaelRaskin>
Well, sometimes san be improved, very often this improvement will make things worse
* shka_
does not like NEST (other for like opening few files at once) i do like ~>
<MichaelRaskin>
Abstractions leak
<_death>
this also applies to LOOP by the way.. of course, many times I also use LOOP and LET* (but not arrows, or for heaven's sake, nest).. but I keep in mind that it's often a crutch
<MichaelRaskin>
Well, computers are crutches because you just cannot calculate in your head fast enough
<_death>
I guess we're now talking past each other with generalizations.. time to do something else then :)
<phoe>
yanno breathing is also a crutch because without it we're dead in like two minutes
<MichaelRaskin>
I just have tried reading ASDF code
<phoe>
oh
<phoe>
that's... a brutal change in topic
<MichaelRaskin>
Well, it _is_ split into smallest possible abstractions
<MichaelRaskin>
So whatever you try reading is… elsewhere
<MichaelRaskin>
But it needs all these extension points
<MichaelRaskin>
If your task is not general enough to need that many extension points, just let all the related logic stay together
IRC-Source_21 has joined #lisp
vyorkin` has quit [Remote host closed the connection]
luni has joined #lisp
shifty has quit [Ping timeout: 272 seconds]
ayuce has joined #lisp
CrazyPython has joined #lisp
roelj has quit [Read error: Connection reset by peer]
ayuce has quit [Remote host closed the connection]
roelj has joined #lisp
luni has quit [Quit: Leaving]
jruiz has joined #lisp
MerlinTheWizard has joined #lisp
CrazyPyt_ has joined #lisp
CrazyPython has quit [Ping timeout: 256 seconds]
jruiz has quit [Remote host closed the connection]
EvW has quit [Ping timeout: 240 seconds]
doomlist3 has quit [Ping timeout: 260 seconds]
fourier has joined #lisp
igemnace has joined #lisp
loli has quit [Quit: WeeChat 2.7.1]
MerlinTheWizard has quit [Ping timeout: 240 seconds]
whythat has quit [Ping timeout: 240 seconds]
EvW has joined #lisp
loli has joined #lisp
doomlist3 has joined #lisp
MerlinTheWizard has joined #lisp
CrazyPython has joined #lisp
CrazyPython has quit [Read error: Connection reset by peer]
doomlist3 has quit [Ping timeout: 260 seconds]
CrazyPython has joined #lisp
_jrjsmrtn has quit [Ping timeout: 246 seconds]
__jrjsmrtn__ has joined #lisp
CrazyPyt_ has quit [Ping timeout: 256 seconds]
lxbarbos` has joined #lisp
frgo_ has joined #lisp
frgo_ has quit [Remote host closed the connection]
frgo_ has joined #lisp
hsaziz has joined #lisp
lxbarbosa has quit [Ping timeout: 246 seconds]
frgo has quit [Ping timeout: 240 seconds]
cpt_nemo has quit [Ping timeout: 256 seconds]
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
quazimodo has quit [Ping timeout: 246 seconds]
bitmapper has joined #lisp
quazimodo has joined #lisp
whythat has joined #lisp
cpt_nemo has joined #lisp
EvW has quit [Ping timeout: 260 seconds]
quazimodo has quit [Ping timeout: 272 seconds]
quazimodo has joined #lisp
rpg has joined #lisp
MerlinTheWizard has quit [Ping timeout: 240 seconds]
<boeg>
i only know realize that those functions - apropos, describe- - i know from emacs are available in common lisp too
<boeg>
TIL
marcoxa has quit [Quit: Hacking done. Dinner time.]
notzmv has quit [Ping timeout: 258 seconds]
<beach>
minion: What does TIL stand for?
<minion>
Tabacum Indiscriminatory Leucocytopenia
<Xach>
phoe: (ql-dist:provided-systems t) also
<boeg>
beach: today i learned
EvW has joined #lisp
<adlai>
... about Tabacum Indiscriminatory Leucocytopenia! sounds like a right nasty diagnosis
<beach>
boeg: Great!
* beach
is off to fix dinner for his (admittedly small) family and then spend time with her.
<phoe>
beach: "til" = "today i learned"
<beach>
Got it.
<boeg>
beach: today i learned = til
<boeg>
did you get it ?
<boeg>
lmao
<phoe>
he will, when he comes back
<boeg>
:P I think he did when he wrote "boeg: Great!" earlier to my message "beach: today i learned", phoe
<boeg>
I'm just joking ;)
* adlai
wonders what #lisp will teach, after the next sun rises
dtman34 has joined #lisp
dtman34 has quit [Remote host closed the connection]
dtman34 has joined #lisp
dtman34 has quit [Remote host closed the connection]
dtman34 has joined #lisp
<phoe>
adlai: whatever is required
dtman34 has quit [Remote host closed the connection]
<phoe>
for instance, did you ever head the tragedy of Darth Plagueis the Wise?...
theseb has joined #lisp
MerlinTheWizard has joined #lisp
* phoe
coughs, hides
sjl has joined #lisp
<boeg>
what ever is this place ...
<boeg>
i'm not sure i get the purpose #clschool
<boeg>
All my questions seem to be answered in here, even though they are quite beginner questions
<Shinmera>
It annoys some people here when too many very obvious beginner questions are asked.
<adlai>
isn't that the dude who tried to implement tagbody using finalizers?
<phoe>
when #lisp is busy with non-beginner discussion, #clschool can be busy with beginner discussion
<Shinmera>
Some people would like deep insightful discussion of lisp, not the same questions noobs ask over and over.
<phoe>
also what Shinmera says
<boeg>
hmm, alright, i guess i have been lucky until now then :)
<phoe>
or just haven't been asked to move it to #clschool
<boeg>
no one has yet asked me to, eh, re-place my questions :)
<boeg>
...thats what i meant
theseb has quit [Quit: Leaving]
Kevslinger has joined #lisp
whythat has joined #lisp
theseb has joined #lisp
<theseb>
I think I get how macros are to create code that generates code. How does that allow the code to do stuff that isn't possible in the language like change the evaluation recipe?
<phoe>
theseb: it isn't about the macro functions themselves, it is the fact that arguments are passed to macro functions without being evaluated
<phoe>
in (foo (+ 2 2)), if foo is a function, it gets 4 as its argument; if foo is a macro, it gets the three-element-list (+ 2 2) as its argument
<theseb>
phoe: oh yea..that changes things ;)
<phoe>
that is what allows the macro to selectively evaluate its arguments in any order and under any conditions it'd like
<phoe>
a macro is just a function; what's interesting is what happens before that function is called and what happens after that function returns
whythat has quit [Ping timeout: 240 seconds]
rogersm has joined #lisp
<theseb>
phoe: when people add , and ,@ in macros....do those evals happen in the code generation phase?
<theseb>
phoe: or is that just specifying how to eval the expanded code later by the evaluator?
<phoe>
theseb: they aren't evals
<theseb>
phoe: i thought , and ,@ implied evals inside a quasiquote
<theseb>
,@ is eval and insert
madage has quit [Ping timeout: 240 seconds]
<theseb>
no?
<phoe>
they don't imply evals
<phoe>
you got it the wrong way around
<theseb>
then what does , and ,@ imply?
<phoe>
everything that IS NOT treated with , and ,@ is quoted
<phoe>
the rest, well, isn't quoted
<theseb>
phoe: are you saying no evaluation takes place in the macroexpansion phase?
<phoe>
no, I'm saying that no evaluation takes place while reader-macroexpanding the quasiquote form
madage has joined #lisp
<theseb>
phoe: to use your example, so expansion will eval the right side and insert (list (+ 2 2) 4) in the code submitted to the evaluator?
<ChoHag>
theseb: ` is the same as ' (it quotes (doesn't evaluate) everything following it) except that ` allows any , it encounters to interrupt the 'don't-evaluate' rule.
<phoe>
this means that the result of calling the macro-function of FOO will be the list (list (+ 2 2) 4)
<phoe>
and that is what the (foo) call will be fully replaced with
<phoe>
and *then* the form is evaluated again
<phoe>
the next attempt at evaluation happens only after the macro function returns.
<ChoHag>
It might help to play around with what ` does without defmacro.
rogersm has quit [Quit: Leaving...]
<ChoHag>
ie. what do '(foo (+ 1 2)) and `(foo ,(+ 1 2)) look like.
<ChoHag>
And `(foo (+ 1 2))
gravicappa has joined #lisp
rogersm has joined #lisp
<theseb>
ok
<theseb>
thanks
<theseb>
phoe: your foo macro really helps
<phoe>
theseb: it's from the smallest meaningful macros that utilize backquote notation in some maybe-meaningful way
<phoe>
note, however, that backquote notation and macros are like macaroni and cheese
<phoe>
they're separate things, they just go real well together
<theseb>
yea
seok has joined #lisp
<seok>
I've just found out AllegroCL has its own webserver and graph db
<seok>
Anyone have experience with these?
<phoe>
seok: some people have been playing with a portability layer for allegro webserver, which is kinda not what you're looking for I think
<seok>
I'm not counting on the portability atm, but just having a consideration as a viable stack commercially
<seok>
phoe: you are saying it runs on allegroCL but not reliable on other implementations right?
<phoe>
seok: I'm saying it's not meant to run on other implementations, and that portability layer makes it possible to run applications that depend on allegro webserver on other implementations
<phoe>
I know nothing about reliability though
<seok>
I've done a fair amount of research on CL web development but I've only found this today
<seok>
Is there a review of it somewhere? perhaps a blog post?
<phoe>
oh wait! aserve is published on LGPL, it's runnable everywhere
<adlai>
theseb, why are you afraid of calling an equality predicate? not to mention, check the comma placement, lest you incur the wrath of an unbound variable
<phoe>
yes, you don't need to use quasiquote at all, but people who need to implement macros in your language are going to not enjoy that fact
<Bike>
"As an example, the above definition implies that `((,a b) ,c ,@d) will be interpreted as if it were (append (list (append (list a) (list 'b) 'nil)) (list c) d 'nil)"
bendersteed has quit [Remote host closed the connection]
<phoe>
...or any form equivalent to the above
<Bike>
yeah "as if it were". the point is it can just a bunch of normal calls like you said.
notzmv has joined #lisp
SGASAU` has joined #lisp
SGASAU has quit [Ping timeout: 260 seconds]
SGASAU` has quit [Remote host closed the connection]
SGASAU` has joined #lisp
<theseb>
Bike: very nice
theseb has quit [Ping timeout: 264 seconds]
hiroaki has quit [Ping timeout: 246 seconds]
fourier has quit [Ping timeout: 260 seconds]
rogersm has quit [Quit: Leaving...]
dale has joined #lisp
hiroaki has joined #lisp
EvW has quit [Ping timeout: 244 seconds]
McParen has left #lisp [#lisp]
SGASAU` has quit [Remote host closed the connection]
SGASAU`` has joined #lisp
luni has joined #lisp
duncan_ has quit [Ping timeout: 258 seconds]
Fare has quit [Remote host closed the connection]
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
mrnatural has left #lisp ["WeeChat 2.3"]
izh_ has quit [Quit: Leaving]
jonatack_ has quit [Ping timeout: 272 seconds]
EvW has joined #lisp
terpri has joined #lisp
sauvin has quit [Ping timeout: 258 seconds]
MerlinTheWizard has quit [Ping timeout: 260 seconds]
sauvin has joined #lisp
MerlinTheWizard has joined #lisp
whythat has joined #lisp
asarch has quit [Quit: Leaving]
whythat has quit [Ping timeout: 240 seconds]
Nilby has quit [Read error: No route to host]
westerns has left #lisp [#lisp]
SGASAU`` has quit [Quit: ERC (IRC client for Emacs 26.3)]
SGASAU has joined #lisp
jonatack has joined #lisp
whythat has joined #lisp
duncan_ has joined #lisp
efm has quit [Ping timeout: 256 seconds]
Inline has quit [Ping timeout: 272 seconds]
nika has quit []
ggole has quit [Quit: Leaving]
Adminisadsfadsf has joined #lisp
<Adminisadsfadsf>
hello from 4chan lisp is a dead language all the good features are in javascript just use JS like a real person thanks bye
shka_ has quit [Ping timeout: 272 seconds]
_paul0 has quit [Ping timeout: 240 seconds]
<Aurora_iz_kosmos>
Adminisadsfadsf: Javascript lacks a Condition system.
<Aurora_iz_kosmos>
It also lacks macros, which is a more easily observable sin.
<Aurora_iz_kosmos>
0/10, try harder OP
<Adminisadsfadsf>
4chan.org/g/thread/75711473
<phoe>
Adminisadsfadsf: true /g/tards know how to respect Lisp-tan, sorry. Also, that's a 404.
<Aurora_iz_kosmos>
If Lain used it, it must be good. :p
<phoe>
you're welcome to move the topic to #lispcafe if you realy want to.
<phoe>
(maphash ... h) is not a proper variable binding
<seok>
h is a hashtable tho
<seok>
is (maphash #'function hash) not how I maphash?
lxbarbos` has left #lisp ["ERC (IRC client for Emacs 28.0.50)"]
rgherdt has joined #lisp
<seok>
Right, I see it
<seok>
missing parantheses
theseb has joined #lisp
<aeth>
I think there are some things you could do that would make that function easier to read
<aeth>
e.g. making the lambdas separate functions, or using a macro over maphash that's easier to read
<aeth>
(like a do-hash-table)
rgherdt has quit [Remote host closed the connection]
<theseb>
are macros *IN* the einvironment? reason for question is I'm wondering if a macro and another thing BOTH are bound to name foo....which one "wins" when the symbol foo is evaluated?
<aeth>
theseb: macros are in the function namespace
<phoe>
theseb: are you writing a lisp-1 or a lisp-2?
<theseb>
phoe: i don't have separate namespaces
<phoe>
oh - if you're writing a lisp-1, then nothing else can be bound to name foo
<phoe>
problem solved
<aeth>
there are several namespaces: variables, functions, types/classes, conditions(?), labels (for goto basically), and I think 1-2 more.
<phoe>
aeth: conditions are just classes/types. there's also catch tags and block names.
<aeth>
If you're writing a Lisp in Common Lisp (iirc?) you can emulate this
<aeth>
phoe: Yes, but I put it separately with a question mark because I'm not sure if that's another thing that doesn't necessarily have to be the case. Conditions are weird.
<theseb>
phoe: so macros are in the same environment as functions...so if create 2 things with the same name....the last one will just clobber the old one?
<aeth>
theseb: Afaik macros are conceptually pretty similar to inline functions here. So they'll be replaced by a function when redefined, but the old code will still be using the "stale" definition.
<aeth>
Since they don't look up the name at runtime
<theseb>
aeith: ok thanks
<phoe>
aeth: no need to have that question mark; condition types don't have a separate namespace, same with condition handlers.
<theseb>
aeth: thanks
<aeth>
phoe: okay, good
<seok>
Well, my program works
<seok>
thanks guys
<seok>
you are legends
moewe has joined #lisp
<phoe>
aeth: conditions are sorta weird, 'cept not to me anymore, I guess
rgherdt has joined #lisp
<aeth>
phoe: well, you wrote the book on them
<phoe>
that's why I hope I'm sorta competent when it comes to answering questions on the condition system
whythat has quit [Ping timeout: 240 seconds]
theseb has quit [Ping timeout: 240 seconds]
<aeth>
the variable/constant namespace (if global, then dynamic variable, else dynamic or lexical), the macro/special-operator/function namespace, the compiler macro namespace, the type/class/condition namespace, the block tag namespace, the go tag namespace.
frgo_ has quit [Remote host closed the connection]
<aeth>
and it doesn't even distinguish conditions from classes here
frgo has joined #lisp
whythat has joined #lisp
<aeth>
This is just asking for a table because there's two dimensions. There's the global/dynamic/lexical dimension that the HyperSpec breaks things down into and then there's the various bindings namespaces that can exist in more than one place (e.g. variables can be global-dynamic, dynamic, or lexical)
<aeth>
(Also note that this is 6 at a minimum. Anyone's free to add their own. It's just a hash table in a macro if you want it to be.)
<Bike>
the other day i realized you could use symbol-macrolet with a specially crafted global definition to get lexical compiler macros or type expanders
<Bike>
dunno why you'd want that, tho
<phoe>
Bike: is there some sorta blogpost about that?
<phoe>
I'll want to read about it
<Bike>
it's not that complicated
<Bike>
uh, let me try actually writing it out
seok45 has quit [Remote host closed the connection]
Fare has joined #lisp
<phoe>
okay
moewe has quit [Remote host closed the connection]
whythat has quit [Ping timeout: 240 seconds]
wello_horld has joined #lisp
<aeth>
imo CL should really be called a Lisp-3 (even though it's more accurately a Lisp-6) because the type/class/condition namespace is as important/common as the variable/function one
<phoe>
the only acceptable numerics here are lisp-0, lisp-1, and lisp-n
<Fare>
lisp--1, lisp-i
<minion>
Fare, memo from phoe: done, added a subsubchapter to the book that you mentioned. Please review it to verify that I haven't made some bugs along the way; thanks.
<wello_horld>
is lisp really better than python
<phoe>
lisp-¼
<wello_horld>
i can't get over the ((()))
<aeth>
phoe: I love lisp-0s because naming things is overrated.
<phoe>
Bike: I will parse it tomorrow; sleep time for me now
<Bike>
good-bye.
<phoe>
niiiiight
hsaziz has quit [Ping timeout: 265 seconds]
luni has quit [Quit: Leaving]
akoana has joined #lisp
hsaziz has joined #lisp
MerlinTheWizard has quit [Ping timeout: 260 seconds]
<Aurora_iz_kosmos>
Lisp-0?
<Bike>
yeah fuck names.
<Aurora_iz_kosmos>
heh
shangul has quit [Ping timeout: 260 seconds]
duncan_ has quit [Quit: Leaving]
<no-defun-allowed>
wello_horld: Put it this way, which language has several compilers, extensive support for metaprogramming, and doesn't have a stupid BDFL?