<beach>
You mean the macro has been *expanded* twice?
<beach>
As I recall, the implementation is free to expand macro forms any number of times. That is why macro expanders should be written in a functional-programming style.
<LdBeth>
I wonder what special treatments to macros that return lambda forms are made in SBCL
<aeth>
interesting observation
<phoe>
LdBeth: macros shouldn't have side effects for that reason
<aeth>
also, should but not must be functional... afaik, you can have an incrementing counter in a macro as long as the only thing that matters is that the number goes up, e.g. some sort of versioning of the generated code
<phoe>
1) because an implementation is allowed to expand them any number of times
<phoe>
2) because *the user* is allowed to expand them any number of times
<phoe>
it isn't about what a macro returns, it's about the fact that it's a macro
<aeth>
Actually, I'm not sure what else would be a safe side effect other than a counter. Maybe logging?
<aeth>
Or creating something if it doesn't yet exist.
<phoe>
idempotent stuff
<phoe>
increasing incf-only counters counts as that, since it ensures "creating stuff that doesn't yet exist"
<phoe>
I wouldn't say logging - why would you want macroexpand-time logging
<phoe>
that would be mostly compile-time logging, too, since in normal program usage most macros would be expanded during file compilation
<no-defun-allowed>
I was going to say "side effects that do the same thing every time", but I guess idempotent is just that.
<LdBeth>
So seems SBCL "backtracks" to compile the form if the repl finds that the returned expression is a lambda
<aeth>
phoe: well, you have to be careful with just saying "counters" because you can't assume that e.g. 5 items exist with that counter since you can macroexpand/macroexpand-1, it can be macroexpanded multiple times, you can recompile forms/files, etc.
<aeth>
so a lot of a counter's assumptions might be wrong
<phoe>
|3b|: you've been mentioned on reddit
<no-defun-allowed>
Yeah, I had to tell off a friend for performing side effects at macroexpansion time instead of in the expanded code.
<no-defun-allowed>
Also, do separate compilation and runtime environments affect this?
ebzzry has joined #lisp
<phoe>
aeth: okay, maybe wrong: multiple macroexpansions must be increasing a singleton counter of sorts, for instance, *GENSYM-COUNTER*.
<aeth>
no-defun-allowed: yeah interning is another thing that works, or in general creating any object if it doesn't yet exist
<phoe>
Still, even #:G0 and #:G0 are distinct objects, so it isn't a hard requirement; macrowriters must just be sure to make them idempotent, whatever it means in a given context.
jprajzne has quit [Quit: jprajzne]
<aeth>
you absolutely can create things in macros, e.g. make-load-form is a thing
<aeth>
just with care
<no-defun-allowed>
In the end, the macro just has to do the "same thing" no matter how many times it's expanded.
<LdBeth>
I think this curious effect only occurs in repl
<phoe>
aeth: obviously; you just need to ensure that creating multiple things of that thing that you create doesn't negatively affect anything
jprajzne has joined #lisp
<|3b|>
phoe: too lazy to go look up reddit login to answer there, but a missing solutions are "send a pull request" and "remind the maintainer to maintain it (and/or help do so)"
<phoe>
okay
* |3b|
does seem to need to take a look at the bugs/PRs there though, added to my todo list (not that being on the list makes it likely to happen particularly soon)
<aeth>
phoe: right, either creating multiple is harmless, or ensuring you only create it once
kopiyka has quit [Remote host closed the connection]
<beach>
I finished incorporating the referee remarks into my article on method combinations. If someone feels like proofreading the fresh version, there is still room for more names in the "Acknowledgments" section. Specifically, I added a figure that has not been checked, and I added examples of the scenarios at the end of section 1. http://metamodular.com/SICL/representing-method-combinations.pdf in case someone wants to have a look.
v_m_v has quit [Ping timeout: 264 seconds]
Cymew has joined #lisp
iAmDecim has joined #lisp
wxie has joined #lisp
<beach>
phoe: I haven't forgotten about you. It is just that we have a deadline for incorporating referee remarks, so I must make sure I meet that deadline.
iAmDecim has quit [Ping timeout: 258 seconds]
random-nick has joined #lisp
Lord_of_Life_ has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
ebzzry has joined #lisp
PuercoPope has quit [Remote host closed the connection]
ebzzry has quit [Read error: Connection reset by peer]
wxie has quit [Remote host closed the connection]
wxie has joined #lisp
pluplog has quit [Remote host closed the connection]
dale has quit [Quit: My computer has gone to sleep]
Duuqnd has joined #lisp
agspathis has joined #lisp
drot has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
ebzzry has joined #lisp
wxie has joined #lisp
wxie1 has joined #lisp
wxie has quit [Ping timeout: 258 seconds]
t58 has joined #lisp
iAmDecim has joined #lisp
wxie1 has quit [Ping timeout: 260 seconds]
frgo has joined #lisp
jprajzne has quit [Quit: jprajzne]
frgo_ has quit [Read error: Connection reset by peer]
Cymew has quit [Ping timeout: 258 seconds]
jprajzne has joined #lisp
frgo has quit [Read error: Connection reset by peer]
frgo_ has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
frgo has joined #lisp
frgo_ has quit [Read error: Connection reset by peer]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
luckless has joined #lisp
davepdot_ has quit [Remote host closed the connection]
<phoe>
beach: no problem. I'll focus on finishing my article, then, so you have a complete work to review.
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
libertyprime has joined #lisp
nicktick1 has joined #lisp
nicktick has quit [Ping timeout: 265 seconds]
Inline has joined #lisp
heisig has quit [Ping timeout: 265 seconds]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
bjorkintosh has joined #lisp
SGASAU has joined #lisp
libertyprime has quit [Read error: Connection reset by peer]
jprajzne has quit [Quit: jprajzne]
libertyprime has joined #lisp
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
ufaucernio has joined #lisp
cosimone has joined #lisp
karlosz has quit [Quit: karlosz]
Bike has joined #lisp
jprajzne has quit [Quit: jprajzne]
xaotuk has joined #lisp
jprajzne has joined #lisp
terpri_ has quit [Ping timeout: 260 seconds]
agspathis has quit [Remote host closed the connection]
jprajzne has quit [Quit: jprajzne]
watkinsr has joined #lisp
rippa has joined #lisp
<watkinsr>
Hey all, does anybody know how I can say `package` a script that does (ql:quickload :something) (something:something) ??
<phoe>
watkinsr: what do you mean by packaging it
<phoe>
do you want to deploy a binary that executes #'something:something?
<watkinsr>
phoe: because otherwise I have to wait for quicklisp to load it every time?
<watkinsr>
phoe: would it be quicker?
nicktick1 has quit [Read error: Connection timed out]
<watkinsr>
phoe: I looked at roswell but roswell doesn't seem to do it for some reason
xkapastel has joined #lisp
<phoe>
watkinsr: I don't know about roswell, but deploying a binary that way will avoid quicklisp operating
nicktick has joined #lisp
<phoe>
since all code will already be loaded in the dumped Lisp image
adam4567 has quit [Remote host closed the connection]
<watkinsr>
phoe: that's what I wanted, nice!
<phoe>
<3
cosimone has quit [Quit: Terminated!]
shifty has joined #lisp
shifty has quit [Client Quit]
jprajzne has joined #lisp
<watkinsr>
phoe: Component "deploy" not found, required by NIL
<watkinsr>
[Condition of type ASDF/FIND-COMPONENT:MISSING-DEPENDENCY]
<watkinsr>
phoe: presumably I need to (ql:quickload :deploy) ?
jprajzne has quit [Quit: jprajzne]
<phoe>
watkinsr: yes
<phoe>
you need to quickload it first
nicktick1 has joined #lisp
<phoe>
once it's downloaded, ASDF will find it
<watkinsr>
phoe: nice, gonna test it all now :D
nicktick has quit [Ping timeout: 265 seconds]
watkinsr has quit [Quit: WeeChat 2.7.1]
jprajzne has joined #lisp
iAmDecim has quit [Ping timeout: 265 seconds]
jprajzne has quit [Quit: jprajzne]
watkinsr has joined #lisp
jprajzne has joined #lisp
<watkinsr>
phoe: thanks, it worked :)
amerlyq has joined #lisp
<phoe>
watkinsr: no problem
ebrasca has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
<watkinsr>
Hey, I'm trying to do the same process over on OpenBSD and I'm getting odd number of &KEY arguments while loading :deploy (MAKE-PATHNAME :NAME "libz" :TYPE)
<watkinsr>
anyway I can see a more in-depth backtrace?
<Shinmera>
If shared objects are also named .so on bsd, it should probably be #+(and unix (not darwin))
heisig has quit [Quit: Leaving]
<watkinsr>
Shinmera: I wouldn't know if they were, how could I check? Where is it looking?
srji has joined #lisp
<phoe>
that's more of a BSD question I think
<phoe>
what is the way in which the OS fetches dynamic libraries
<Bike>
should probably have an #-(or ...) (error ...) there for this kinda thing
<phoe>
^
<Shinmera>
That too.
<Shinmera>
I'm busy right now though, so
<watkinsr>
Shinmera: no worries, I'll see if I can fix it later
ebzzry has quit [Read error: Connection reset by peer]
Josh_2` has quit [Quit: ERC (IRC client for Emacs 26.3)]
Josh_2 has joined #lisp
frgo has quit []
Codaraxis has joined #lisp
Codaraxis__ has quit [Ping timeout: 265 seconds]
<eta>
how do you get ~X in FORMAT to print with padding?
<eta>
I tried: (format nil "~(~{~2,0X~}~)" '(1 2 3))
<eta>
; Evaluation aborted on #<TYPE-ERROR expected-type: CHARACTER datum: 0>.
<Bike>
try '0, i think
<eta>
Bike, works, thanks :)
<eta>
(now why's it like that...)
<Bike>
for format parameters a number is interpreted as an actual number, and you need the quote to indicate a character.
<Bike>
"Prefix parameters are notated as signed (sign is optional) decimal numbers, or as a single-quote followed by a character. For example, ~5,'0d can be used to print an integer in decimal radix in five columns with leading zeros, or ~5,'*d to get leading asterisks. "
<phoe>
watkinsr: yes, that's doable as well. deploy is just a portability library that abstracts away the implementation's means of dumping images.
<watkinsr>
phoe: gotcha, but somehow the way deploy looks for libz must be different or rather, this method doesn't use libz?
Kundry_Wag has quit [Ping timeout: 256 seconds]
cosimone has joined #lisp
<Josh_2>
phoe I didn't know asdf could portably dump images, that's very useful :)
EvW has joined #lisp
jprajzne has quit [Quit: jprajzne]
beach` has joined #lisp
<phoe>
watkinsr: you didn't use SBCL core compression.
<phoe>
if you compress the resulting image, it will be smaller, but zlib will be required to execute it.
beach has quit [Ping timeout: 272 seconds]
beach` is now known as beach
iAmDecim has joined #lisp
cosimone has quit [Quit: Terminated!]
cosimone has joined #lisp
cosimone has quit [Client Quit]
asarch has joined #lisp
EvW has quit [Ping timeout: 272 seconds]
wxie has joined #lisp
libertyprime has quit [Read error: Connection reset by peer]
cosimone has joined #lisp
orivej has joined #lisp
ebzzry has joined #lisp
jprajzne has joined #lisp
davepdotorg has joined #lisp
izh_ has quit [Quit: Leaving]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
davepdotorg has quit [Ping timeout: 256 seconds]
esrse has joined #lisp
<jcowan>
ISLisp nails down that macro expanders, while not required to be completely functional, cannot have any side effects that leak out of the macro. For example, if the macro creates a cons, it may do a rplaca/d on that cons, but it cannot do I/O, or change the plist of any symbol, or attempt to modify any code. (As usual, allocation is not considered a side effect.)
esrse has quit [Read error: Connection reset by peer]
iAmDecim has quit [Ping timeout: 256 seconds]
esrse has joined #lisp
<_death>
when you say "cannot", do you mean "must not", or an actual mechanism
xuxuru has joined #lisp
* splittist
realises for the nth time that data-driven is less error-prone than ... whatever the other thing is he keeps making mistakes with.
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
<jcowan>
splittist: Smart data and dumb code beats smart code and dumb data every time.
ym has joined #lisp
<jcowan>
_death: I mean that the consequences are undefined
<jcowan>
the compiler need not even expose read (for example) to macro expanders.
<jcowan>
OTOH, macros are evaluated at compile time, but eval does not exist in the language, so the compiler needs an evaluator but the runtime does not.
<jcowan>
ISLisp is an attempt to make a Lisp that is as static as possible (not however statically _typed_). For example, classes cannot be changed at run time, nor can the class of an instance be altered.
ecraven has quit [Ping timeout: 272 seconds]
niceplace has quit [Ping timeout: 260 seconds]
<beach>
Do you happen to know the reason that they wanted to make something more static?
<jcowan>
Run-time efficiency, given that although JITs existed (since 1977) they were not widely understood or used.
<beach>
I see. So the basis for their design may no longer be valid, like the decision to have C++ use "manual" memory management.
<jcowan>
Its principles are: "No loading, evaluation, compilation, or macroexpansion. No reflection on symbol values. No computed type specifiers, class names, or slot names. Packages are immutable except for interning new symbols. Classes are immutable. The class of an instance is immutable."
iAmDecim has joined #lisp
jprajzne has quit [Quit: jprajzne]
<beach>
What is the main use case for such a restricted language?
<beach>
I mean, I can see that it would be fun to create it, of course.
ecraven has joined #lisp
<jcowan>
That was definitely my motivation in inventing (or perhaps the word is discovering) CL-R.
<beach>
Got it.
<jcowan>
But I would assume it could be competitive with AOT-compiled garbage collected languages like Go, with much more richness and, well, being a Lisp.
<jcowan>
(devops in Common Lisp!)
<beach>
The first phrase suggests that, without the restriction, programs can't be efficiently compiled, and efficient code can't be generated.
wxie has quit [Ping timeout: 260 seconds]
lalilulelo has quit [Quit: Leaving]
<beach>
Do you have any hard evidence that this suggestion is true?
<jcowan>
They certainly can be, provided your compiler can recover information about de facto immutability from the code
ecraven has quit [Client Quit]
<jcowan>
R6RS introduced a feature whereby all programs requiring either mutable conses or mutable strings had to be flagged up front so that a different compilation strategy and run-time library could be used if they were known not to exist. AFAIK no R6RS implementation took advantage of this.
<beach>
I consider us very lucky with Common Lisp because we always have the entire program at our disposal. It can be considered immutable until it is modified, and then, since we have the compiler at our disposal, we can compile stuff again with the new immutability assumption.
<Bike>
it seems like this kind of thing could be good for distributing complete programs to non-programmers and stuff like that, while still doing development in normal lisp
<jcowan>
Such was the original 1977 JIT for APL, a language widely believed to be uncompilable then and since.
<Bike>
as opposed to the usual image dump thing
<jcowan>
Well, I wouldn't recommend writing full CL and then using a linter to detect CL/R violations, because often they will require rethinks.
ecraven has joined #lisp
<Bike>
sure. i mean, you write your program as a normal CL program, and then when it comes to deploy you gather everything up and look it over for reflection to remove
<jcowan>
Yes, that's what I would not recommend
<jcowan>
the reflection may be deep in the code somewhere, such that you have to change a lot of stuff to fix it.
Kundry_Wag has joined #lisp
<ebrasca>
Do you know some tests to test some file system inplementation in cl?
<phoe>
ebrasca: ANSI-TEST has a test suite
<phoe>
if you're looking for tests that Mezzano should pass, you could use these
ecraven has quit [Ping timeout: 250 seconds]
<ebrasca>
phoe: I like to test fat32 implementation.
ArthurStrong has quit [Quit: leaving]
shifty has joined #lisp
jprajzne has joined #lisp
esrse has quit [Remote host closed the connection]
efm has quit [Ping timeout: 265 seconds]
efm has joined #lisp
conjunctive has joined #lisp
<phoe>
ebrasca: I don't know if anyone ever wrote any Lisp tests for that.
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
iAmDecim has joined #lisp
xuxuru has joined #lisp
<LdBeth>
jcowan: well there's a similar thing named Standard Lisp
<jcowan>
I'm familiar with it, but it is definitely not CL-compatible
<LdBeth>
It doesn't not have macro and is offline compiled to C
<jcowan>
CL-R does have macros, and indeed the macro expanders are written in full CL
shangul has joined #lisp
jayspeer has joined #lisp
<LdBeth>
I think the benefit is able to distribute the product without a heavy runtime, but I doubt if the runtime efficiency can be improved by a noticeable amount compared to a full featured CL
iAmDecim has quit [Ping timeout: 265 seconds]
iAmDecim has joined #lisp
asarch has joined #lisp
KahMue has joined #lisp
xuxuru has quit [Quit: xuxuru]
sjl has joined #lisp
asarch has quit [Ping timeout: 265 seconds]
Bourne has quit [Ping timeout: 265 seconds]
<jcowan>
Well, you can tree-shake the runtime and probably should.
shangul has quit [Ping timeout: 258 seconds]
mjsir911 has quit [Quit: Goodbye, World!]
mjsir911 has joined #lisp
Duuqnd has quit [Quit: Leaving]
izh_ has quit [Quit: Leaving]
Bourne has joined #lisp
efm has quit [Ping timeout: 260 seconds]
efm has joined #lisp
z147_ has quit [Remote host closed the connection]
pilne has joined #lisp
z147_ has joined #lisp
arduo has joined #lisp
<phoe>
fouric: could you delete the fork of my gist? It's an early version of my work, and I am still thinking of how to publish it once it's finalized.
jayspeer has quit [Quit: ERC (IRC client for Emacs 26.3)]
Involuntary has joined #lisp
Jeanne-Kamikaze has quit [Read error: Connection reset by peer]
srandon111 has joined #lisp
gravicappa has quit [Ping timeout: 256 seconds]
FennecCode has quit [Remote host closed the connection]
KahMue2 has joined #lisp
KahMue2 has quit [Remote host closed the connection]
ggole has quit [Quit: Leaving]
iAmDecim has quit [Ping timeout: 256 seconds]
iAmDecim has joined #lisp
SGASAU has quit [Remote host closed the connection]
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #lisp
space_otter has joined #lisp
shifty has quit [Ping timeout: 256 seconds]
dale has joined #lisp
Oladon has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Kundry_Wag has quit [Remote host closed the connection]
Lord_of_Life_ is now known as Lord_of_Life
Kundry_Wag has joined #lisp
efm_ has joined #lisp
efm has quit [Ping timeout: 265 seconds]
Kundry_Wag has quit [Ping timeout: 260 seconds]
KahMue has left #lisp [#lisp]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
twelvemonkeys has quit [Ping timeout: 265 seconds]
twelvemonkeys has joined #lisp
hhdave has quit [Quit: hhdave]
EvW1 has quit [Ping timeout: 260 seconds]
hhdave has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 256 seconds]
_jrjsmrtn has joined #lisp
efm_ has quit [Quit: Konversation terminated!]
efm has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 265 seconds]
frgo has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
tutti has quit [Remote host closed the connection]
frgo has joined #lisp
cosimone has quit [Quit: Quit.]
FennecCode has joined #lisp
FreeBirdLjj has quit [Ping timeout: 260 seconds]
peterhil has quit [Read error: Connection reset by peer]
peterhil` has joined #lisp
davepdotorg has joined #lisp
iAmDecim has quit [Ping timeout: 260 seconds]
davepdotorg has quit [Ping timeout: 265 seconds]
PuercoPope has joined #lisp
peterhil has joined #lisp
peterhil` has quit [Ping timeout: 265 seconds]
Codaraxis has quit [Read error: Connection reset by peer]
Steinberg2010 has quit [Ping timeout: 272 seconds]
terpri has joined #lisp
Oddity has quit [Ping timeout: 250 seconds]
Kundry_Wag has joined #lisp
hhdave has quit [Quit: hhdave]
Oddity has joined #lisp
random-nick has quit [Ping timeout: 250 seconds]
z147_ has quit [Quit: z147_]
Oddity has quit [Ping timeout: 256 seconds]
Oddity has joined #lisp
xkapastel has joined #lisp
Oddity has quit [Ping timeout: 260 seconds]
xaotuk has quit [Ping timeout: 256 seconds]
mseddon has quit [Read error: Connection reset by peer]
amerlyq has quit [Quit: amerlyq]
FennecCode has quit [Quit: ERC (IRC client for Emacs 26.2)]