Kundry_W_ has quit [Remote host closed the connection]
mfiano has joined #lisp
robotoad has quit [Quit: robotoad]
slyrus1 has joined #lisp
dddddd has quit [Remote host closed the connection]
Naergon has joined #lisp
<didi>
aeth: I usually avoid `destructuring-bind' because I feel it freezes implementation.
<whartung>
???
<mfiano>
What does that even mean?
<didi>
By using `destructuring-bing', I feel I won't be able to freely change a data structure implementation. So, If I say (destructuring-bind (a . b) foo ...), `foo' is set to be a cons, with `a' as the `car' and `b' as the `cdr'.
<whartung>
so you’d rather return a structure or class?
<aeth>
If you use destructuring-bind, you can usually tell if something doesn't match what you expect pretty quickly. If you use cadr or whatever, you might never refactor it properly
<didi>
whartung: So I would rather use accessor functions.
<mfiano>
If it's built out of conses, it is trivial to parse with destructuring-bind. You argument holds better for arrays or hash tables.
<mfiano>
Also trivial to change
<aeth>
Accessor functions are an alternative, but they're probably less efficient.
<didi>
aeth: *nod*
<aeth>
If you're calling (cadr foo) and (caddr foo) through inline accessor functions you're probably going through the list twice (and certainly if they're not inline), and you could have nonsense at the end unless you do another check.
xantoz has quit [Ping timeout: 256 seconds]
<pjb>
if you care abt releating accesses with cadr cadddr, then you should use defstruct.
<pjb>
(or clos)
xantoz has joined #lisp
<aeth>
It is a minor point, yes.
<aeth>
Sometimes you have no choice, though, like in macros (okay, you can probably use a reader macro to create structs at compile-time and use make-load-form-saving-slots to save the compile-time object so it's handled as a constant at runtime... but why?)
<aeth>
s/compile-time/read-time/
<aeth>
I wonder if make-load-form-saving-slots works at read time
akkad has joined #lisp
<aeth>
I find that either accessor functions or destructuring-bind (assuming it's not in a macro) is usually the first step to replacing it with a data structure, though
<pjb>
aeth: there's already a reader syntax for literal structures: #S(point :x 42 :y 33)
<pjb>
and if at any time you're worried about evolutivity of an implementation choice, you can always wrap it in a macro. Don't use destructuring-bind, use your own macro, that could expand to either that, or a with-accessors or a with-slots or something else.
oldtopman has quit [Quit: *pouf*]
<didi>
I've done that ^, tho I didn't feel it was better than simply using LET and accessors.
<aeth>
pjb: I usually hide complicated things behind symbol-macrolet or with-accessors or something similar
fikka has joined #lisp
<pjb>
didi: that is, it's better if you have to use it several times, or if it has to have an implementation that should be consistent with some other such macro or operator.
<pjb>
it is easier to ensure consistency in a mechanism, when it is implemented independently and separately from the rest of the code.
dogon has joined #lisp
<pjb>
Also having such abstractions helps when you need to debug, since you can easily instrument those abstractions (add checks).
<aeth>
add checks for debugging?
<aeth>
hah
<aeth>
I usually just keep the checks in there.
<pjb>
Yes. There are quick and easy checks that you can add when debugging and leave in production, but you can also add heavy checks (things that walk whole data structures, or perform complex computations to validate).
fikka has quit [Ping timeout: 240 seconds]
<pjb>
Note that I speak generally, here, not specifically for CL. I'm currently working on FreeRDP written in C, and it's horrible.
<aeth>
I created a typed cons cell out of structs that's about 30% slower than the built-in cons, but it saves having to walk the data structure to verify things (just check the type in O(1))
<aeth>
Of course, not everything can be expressed in types like that
Kundry_W_ has joined #lisp
<pjb>
note that clisp can be compiled with a clisp compilation time option to add a slot to cons cells for your own usage.
<aeth>
Using structs is mostly portable because :type on a slot is usually at least somewhat respected. Full portability would require testing implementation behavior and wrapping the or check-type in places where it isn't respected on various implementations.
<pjb>
Yes.
<pjb>
check-type must not be used indiscriminately. Sometimes you must rely on the intrinsic type checking.
Oddity has quit [Ping timeout: 248 seconds]
dogoff has joined #lisp
papachan has quit [Quit: Connection closed for inactivity]
dogon has quit [Ping timeout: 268 seconds]
Oddity has joined #lisp
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
patlv has joined #lisp
zachk has quit [Quit: Leaving]
edgar-rft has quit [Remote host closed the connection]
BitPuffin has quit [Remote host closed the connection]
skapata has quit [Remote host closed the connection]
milanj has quit [Quit: This computer has gone to sleep]
buffergn0me has joined #lisp
parjanya has joined #lisp
elfmacs has joined #lisp
markoong has quit [Remote host closed the connection]
fikka has joined #lisp
elfmacs has quit [Ping timeout: 248 seconds]
fikka has quit [Ping timeout: 248 seconds]
elfmacs has joined #lisp
JuanDaugherty has quit [Quit: Exeunt]
krwq has joined #lisp
<krwq>
which doc generator would you could recommend?
mindCrime_ has quit [Ping timeout: 248 seconds]
Kundry_W_ has quit [Remote host closed the connection]
<nowhere_man>
I'm starting to understand the concept of delimited continuations in the basic theory, but now I wonder: what are their typical uses?
``Erik_ has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
<LdBeth>
nowhere_man: multi processing
fikka has quit [Ping timeout: 268 seconds]
<White_Flame>
I find undelimited continuations way more confusing than delimited
<White_Flame>
delimited continuations are basically registering an lambda event handler from within a closure, for example
<White_Flame>
(depending on syntactic sugar)
<White_Flame>
(and depending on personal definition)
housel has quit [Remote host closed the connection]
housel has joined #lisp
Kundry_Wag has joined #lisp
Kundry_W_ has joined #lisp
graphene has quit [Remote host closed the connection]
edgar-rft has joined #lisp
graphene has joined #lisp
Kundry_Wag has quit [Ping timeout: 256 seconds]
robotoad has joined #lisp
bjorkintosh has joined #lisp
Kundry_W_ has quit []
Kundry_Wag has joined #lisp
robotoad has quit [Quit: robotoad]
eli_oat has joined #lisp
mindCrime_ has joined #lisp
elfmacs has quit [Ping timeout: 260 seconds]
elfmacs has joined #lisp
k4rtik has joined #lisp
robotoad has joined #lisp
elfmacs has quit [Ping timeout: 248 seconds]
shrdlu68 has joined #lisp
elfmacs has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
Kundry_Wag has quit [Remote host closed the connection]
Pixel_Outlaw has quit [Remote host closed the connection]
xenosoz has joined #lisp
moei has quit [Quit: Leaving...]
xenosoz has quit [Client Quit]
pseudonymous has joined #lisp
dmiles has quit [Ping timeout: 268 seconds]
dmies has joined #lisp
<akkad>
org-mode ftw :P
eli_oat has quit [Quit: Leaving.]
shka_ has joined #lisp
doesthiswork has quit [Quit: Leaving.]
pjb has quit [Remote host closed the connection]
doesthiswork has joined #lisp
pjb has joined #lisp
wheelsucker has joined #lisp
dmies has quit [Ping timeout: 260 seconds]
dmiles has joined #lisp
fikka has joined #lisp
xantoz has quit [Ping timeout: 248 seconds]
fikka has quit [Ping timeout: 240 seconds]
xantoz has joined #lisp
pseudonymous has quit [Ping timeout: 256 seconds]
elfmacs has quit [Ping timeout: 264 seconds]
moei has joined #lisp
k4rtik has quit [Ping timeout: 240 seconds]
milanj has joined #lisp
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
vlatkoB has joined #lisp
<drmeister>
Does anyone have insight into how to implement the optimization where functions that call each other within a compilation unit call each other directly?
sauvin has joined #lisp
<oni-on-ion>
directly? inline?
shifty has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 255 seconds]
fikka has joined #lisp
shka_ has quit [Ping timeout: 240 seconds]
nickenchuggets has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
fikka has quit [Ping timeout: 255 seconds]
<mfiano>
pillton: I got your message. I actually get a warning when quickloading specialization-store now
buffergn0me has joined #lisp
iskander has joined #lisp
<beach>
Good morning everyone!
<beach>
drmeister: Instead of going through the function name, you do a relative jump since the two functions are in the same code body.
jasom has quit [Ping timeout: 256 seconds]
<beach>
But, if you do that, you can no longer redefine the callee by hitting C-c C-c in SLIME.
djinni` has quit [Quit: Leaving]
nika has joined #lisp
<drmeister>
Hello - yes - I realize I won't be able to redefine the callee.
<beach>
Also, functions can have more than one entry point. You don't need to check the number of arguments for such a call.
<drmeister>
In most cases the callee will be in the top level environment - what if it isn't?
<beach>
Too early in the morning for me to figure that out.
<drmeister>
Thanks
<beach>
How is clasp performance doing these days, by the way?
iridioid has quit [Ping timeout: 240 seconds]
doesthiswork has quit [Quit: Leaving.]
<drmeister>
I don't feel like it's been improving much lately.
dogoff has quit [Remote host closed the connection]
<beach>
Do we know where improvement is needed?
<drmeister>
It's like a sore tooth that I keep probing. I'm not sure where the problem is.
<beach>
Oh, OK.
<drmeister>
Comparing it to sbcl and clisp? Absolutely improvement is possible and needed.
<drmeister>
Profiling is not very useful.
djinni` has joined #lisp
<drmeister>
We are stuck on a couple of fronts. Inlining is still broken and so we can't bring the new cst compiler online. That is very frustrating.
<beach>
I understand.
<drmeister>
Martin is just starting up - I'm hoping for progress.
<beach>
I forget, is he a compiler expert?
andrei-n has joined #lisp
elfmacs has joined #lisp
parjanya has left #lisp ["ERC (IRC client for Emacs 27.0.50)"]
fikka has joined #lisp
parjanya has joined #lisp
oldtopman has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
parjanya has quit [Read error: Connection reset by peer]
test1600 has joined #lisp
vlad_ has joined #lisp
vlad_ is now known as DonVlad
fikka has joined #lisp
<drmeister>
I'm not sure - are any of us?
mlf|2 has quit [Read error: Connection reset by peer]
fikka has quit [Ping timeout: 240 seconds]
brettgilio has joined #lisp
test1600_ has joined #lisp
test1600 has quit [Ping timeout: 240 seconds]
pierpal has quit [Read error: Connection reset by peer]
Oddity has quit [Read error: No route to host]
felideon has joined #lisp
fikka has joined #lisp
oni-on-ion has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 256 seconds]
iridioid has joined #lisp
vertigo has quit [Ping timeout: 264 seconds]
vertigo has joined #lisp
pierpal has joined #lisp
fikka has joined #lisp
iridioid has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 256 seconds]
_whitelogger has joined #lisp
milanj_ has joined #lisp
milanj has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
Oddity has joined #lisp
robotoad_ has joined #lisp
lnostdal has joined #lisp
robotoad has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 260 seconds]
littlelisper has joined #lisp
buffergn0me has quit [Ping timeout: 264 seconds]
random-nick has joined #lisp
aindilis has quit [Remote host closed the connection]
shrdlu68 has joined #lisp
xantoz has quit [Ping timeout: 240 seconds]
xantoz has joined #lisp
littlelisper has left #lisp [#lisp]
fikka has joined #lisp
aindilis has joined #lisp
milanj_ has quit [Quit: This computer has gone to sleep]
fikka has quit [Ping timeout: 240 seconds]
robotoad_ has quit [Quit: robotoad_]
milanj_ has joined #lisp
EvW has joined #lisp
littlelisper has joined #lisp
brettgilio has quit [Remote host closed the connection]
pjb has quit [Ping timeout: 245 seconds]
xrash has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
robotoad has joined #lisp
lumm has joined #lisp
shrdlu68 has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 240 seconds]
shrdlu68 has joined #lisp
Domaldel has joined #lisp
haom has joined #lisp
FreeBirdLjj has joined #lisp
Tristam has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
wigust- has joined #lisp
<littlelisper>
how do i retrieve and save a file? any reference is helpful
<beach>
p_l: Do you mean when a function in a compilation unit is redefined?
<p_l>
regarding direct references et al, yes
<beach>
It is tricky stuff. I am pretty sure you don't have the right to recompile callers from source code. The environment may have changed since last compilation.
<p_l>
beach: I was thinking more of just updating the reference
<beach>
To the callee?
<p_l>
inside caller
<beach>
The call sequence will likely have changed.
<littlelisper>
compiling my defpackage gives me "bogus DEFPACKAGE option: (:USE-IMPORT-FROM :CL-PPCRE :SCAN-TO-STRINGS)"
<p_l>
beach: if the interface of the callee changed, I think the code *should* error out
<beach>
p_l: At the very least, the direct call contains a relative callee address and after update, it must have an indirection through the symbol or the environment.
<beach>
Oh, sure. That's not what I meant.
<p_l>
beach: I was thinking of using absolute addresses instead, and essentially handling it the same way one would handle GC-movable code
<beach>
Well, then you are not taking full advantage of the internal call.
<p_l>
beach: depends a bit on how the underlying architecture handles it
<littlelisper>
sorry, its import-from. i got it
<p_l>
but I can see it workable with relative references anyway
fikka has quit [Ping timeout: 260 seconds]
<p_l>
also, one could patch the callee location with a jump to new code, and have GC hooks that fixup it later
<p_l>
though the latter requires that all code moves only in the area supported by relative call
fikka has joined #lisp
<beach>
It gets complicated.
makomo has quit [Ping timeout: 260 seconds]
<p_l>
AMD64 for example only gives 32bit relative addressing, which is something I once considered for a rather "larger" compilation unit
<p_l>
where compilation unit also marked all data/code to fit into 2GB block
<p_l>
with a compilation unit header that had references elsewhere
<p_l>
(this could be in theory applied to smaller units down to individual thunks even)
<p_l>
beach: doing it like that would also fit with my ideas of marrying your single-level-storage for OS with some robust real hw :)
Bike has joined #lisp
pseudonymous has joined #lisp
<beach>
Yes, I see.
<beach>
Perhaps the easiest thing to do is to require the programmer to us NOTINLINE for a function that can be redefined separately. Then there is no obligation to make it work otherwise, because the callee could very well have been inlined, so that redefining it won't have any effect anyway. Then for NOTINLINE, generate a full call so that redefinition works as expected.
<p_l>
then compilation unit becomes essentially a "segment" which has a external reference table, a table of its own contents, and can be as big or as small as it needs to be (because we could do transparent segment nesting)
<beach>
I think I understand.
rawste has joined #lisp
<p_l>
and inside a segment, the IP-relative offsets could be market by debug data and updated when necessary (done right, one could also "fork" segments)
metallicus_ has joined #lisp
Arcaelyx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fikka has quit [Ping timeout: 248 seconds]
metallicus_ has quit [Quit: Leaving]
metallicus has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
fikka has joined #lisp
metallicus has quit [Quit: Leaving]
hph^ has quit []
budRich has joined #lisp
littlelisper has quit [Quit: leaving]
orivej has joined #lisp
<pjb>
beach: what you're describing is what is specified AFAUI.
fikka has quit [Ping timeout: 240 seconds]
<budRich>
hello lisp people. Im currently in the transition phase of going from i3 to stumpwm and sublime to emacs (don't ask why). And it feels like i need to get a good understanding of and learn some lisp. It's all a bit overwhelming right now, with all the different dialects and stuff, just thought i would ask here how YOU got started: book, cource, emacs, dialect, whatever.
<Bike>
stumpwm is common lisp, so go with that
<pjb>
budRich: emacs lisp is different from common lisp.
<pjb>
But a alot of what you'll learn in CL will be appliable in emacs lisp.
<budRich>
great, this is what i thought and planned, i try to conf stump and get used to that first, before starting with emacs, it feels like it can get confusing. And wm hacking is my cup of tea.
<beach>
OK, I created an appendix describing how I plan to adapt Doug Lea's allocator to SICL. I would appreciate if y'all would take a look. It is the first draft so far, and I will likely work on the details later: http://metamodular.com/allocator.pdf
<pjb>
AFAUI = mispelled AFAIUI = A Far As I Understand It; sorry.
<beach>
Ah, OK.
<beach>
Yes, I think you are right.
<shka1>
beach: i will take a look at it tomorrow
<shka1>
btw, one thing occured to me
<beach>
shka1: No rush. Just thought you might be interested since I think I figured it out.
<beach>
What's that?
<shka1>
why do you want to coalescent blocks backward?
<shka1>
aren't you starting from the very front and just move forward?
rawste has joined #lisp
<shka1>
that's is garbage collector afterall
<beach>
No, no. This is a global memory allocator. It handles free chunks and chunks in use.
<beach>
And I can't start for be very front, because that would be the entire memory.
<shka1>
oh, ok
<shka1>
so not nursery
<beach>
No, all memory. I will use it for the global heap.
elfmacs has quit [Ping timeout: 240 seconds]
<shka1>
ok
fikka has quit [Ping timeout: 260 seconds]
<edgar-rft>
I don't think it rally matters what acronyms like WRKZTG really mean because people using such things don't show the slightest interest to be understood by others, so their opinion should be totally ignored.
milanj has quit [Read error: Connection reset by peer]
<beach>
I am still surprised that I seem to be one of the few people using Emacs abbrevs.
<edgar-rft>
beach: in human-readable text? :-)
<beach>
I don't understand.
<edgar-rft>
beach: Imagine a doctoral thesis full of unexpanded Emacs abbrevs.
<beach>
Why would they be unexpanded?
milanj has joined #lisp
Quetzal2 has joined #lisp
Quetzal2 has quit [Changing host]
Quetzal2 has joined #lisp
<Bike>
i'm just imagining that beach types like a champion texter, but we can't tell because of all the abbreviation expansions
<beach>
I mean, when I type (say here in IRC) "gme", it expands to "Good morning everyone!", and when I type "hs" it expands to "Common Lisp HyperSpec", so I don't need to expose other participants to such abbreviations.
<edgar-rft>
beach: what if I wrote my doctioral thesis with vim? would emacs abbrevs expanded there?
<beach>
That would be unwise.
<shka1>
heh, i just found my quote of the day
<shka1>
"Forgetting how to implement a Prolog system is as hard as learning how to build one."
<shka1>
;-)
zxcvz has joined #lisp
budRich has quit [Ping timeout: 256 seconds]
<edgar-rft>
beach: My original rambling was about abbrevs like AFAIUI in text intended to be read by humans. Of course I have no problem if anyone uses the capabilities of his/her editor to make life less painful, as long as I don't need to read unexpanded abbrevs like AFAIUI in plain text.
<beach>
I understand.
<beach>
I just pointed out an easy way to avoid that, without having to manually expand those abbreviations. But I take it very few people use that way.
<edgar-rft>
Many people like tp use computers to make life *more* complicated than otherwise around.
lumm_ has joined #lisp
lumm has quit [Ping timeout: 240 seconds]
lumm_ is now known as lumm
metallicus has quit [Quit: Leaving]
<Xach>
/win 3
xantoz has quit [Ping timeout: 264 seconds]
malice has joined #lisp
<pjb>
Ok, so the message is: go read the emacs abbrevs tutorial this week end!
<pjb>
I'm lazy, I've been using emacs for at least 26 years, and I never had a look at abbrev…
<shka1>
:-)
<beach>
pjb: Yeah, you are not alone apparently.
<pjb>
On the other hand, I wrote my own pjb-erc-answers for my own FAQ answers :-)
xantoz has joined #lisp
elfmacs has joined #lisp
doesthiswork has joined #lisp
milanj has quit [Read error: Connection reset by peer]
<malice>
Hi! Macro question: I'm struggling with creating this macro. Here's my effort: https://pastebin.com/4t0mGHaB
<malice>
The macro is basic with simple twist: it defines another macro(with macrolet) so that I don't have to pass the variable (parser) all the time in there.
<malice>
However, I get errors and I'm not sure how to get it right. The error is either "variable parser is unbound" or "variable parser-name is unbound"
TCZ has joined #lisp
<malice>
both happen during macroexpansion
<malice>
parser is unbound if parser-name is double-unquoted, parser-name is unbound if parser-name is single-unquoted
<Bike>
maybe ,',
<shka1>
,',
<Bike>
i avoid double backquote and just write it out manually with list functions, usually
<shka1>
malice: i have this issues all the time, just use ,', instead of ,, for variable name
<Bike>
that said, this isn't going to work
<Bike>
you have (previous) expanding into another (previous ...) form
<malice>
is that going to be recursive?
<Bike>
so you'll just get a not-enough-arguments error. yes.
<malice>
I will simply modify the name of the function the
<malice>
shka1: these are some great macro names :)
<shka1>
thanks :P
<shka1>
i don't document those on purpose :P
pseudonymous has joined #lisp
<pjb>
malice, it's not obvious that previous needs to be a macro. If it was a flet, you could call the outter previous function from an inner previous function with a different signature.
<pjb>
Same with match.
milanj_ has joined #lisp
<pjb>
malice: and a flet can also use an outter macro of the same.
<malice>
pjb: I wanted to avoid it overwriting the function slot of the previous since I wasn't sure if that wouldn't affect other functions that call it
milanj has quit [Ping timeout: 256 seconds]
<pjb>
flet is lexical.
<malice>
I see. My assumption was invalid then.
<pjb>
just like macrolet, so you if you can use one, you can use the other.
igemnace has quit [Remote host closed the connection]
knicklux has joined #lisp
<pjb>
beach: after having read (only) C.1 we don't understand why the in-use bit is stored in the next chunk. And the diagrams don't even show the next of the next chunk, so the information displayed is incomplete.
<pjb>
beach: what use are the chunks that don't have free space in them? bin 0 seems useless.
sz0 has joined #lisp
<pjb>
beach: page 198 s/cunks/chunks/ there are other typoes, but this one can't stay ;-)
didi has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
dddddd has joined #lisp
gabiruh has quit [Ping timeout: 256 seconds]
TCZ has quit [Quit: Leaving]
<beach>
pjb: Thanks.
bjorkintosh has quit [Quit: Leaving]
<beach>
Only free chunks have 4 words with valid data. A chunk in use has only 1, so there are 3 words for user data.
<beach>
... in the smallest chunk.
<beach>
The in-use bit is stored in the next chunk so that when a chunk is freed, you can check whether the previous chunk is in use. If it is not in use, the previous word is the size and you can use it to find the beginning of the previous chunk.
<beach>
If it is in use, you can't do that because the size field is then used by user data, so you must have this bit to check which case it is.
fikka has joined #lisp
jmercouris has joined #lisp
<beach>
pjb: I have yet to write the section on freeing a chunk, so it is normal that this is not clear from the current document.
josemanuel has joined #lisp
karswell has quit [Ping timeout: 245 seconds]
elfmacs has quit [Quit: WeeChat 2.1]
azimut has quit [Ping timeout: 260 seconds]
fikka has quit [Ping timeout: 245 seconds]
deng_cn has quit [Remote host closed the connection]
<beach>
Interestingly, since these chunks are going to be used for the racks, and many racks need a size stored in them (like for arrays), I can sometimes use the size field of the chunk instead of storing the size separately.
makomo has quit [Ping timeout: 260 seconds]
makomo has joined #lisp
skapata has joined #lisp
pseudonymous has joined #lisp
pseudonymous has quit [Remote host closed the connection]
pseudonymous has joined #lisp
lumm has quit [Read error: Connection reset by peer]
pseudonymous has quit [Remote host closed the connection]
pseudonymous has joined #lisp
lumm has joined #lisp
<beach>
Hmm, this thing is so simple, I should just go ahead and code it up.
pseudonymous has quit [Remote host closed the connection]
lumm_ has joined #lisp
pseudonymous has joined #lisp
lumm has quit [Ping timeout: 260 seconds]
lumm_ is now known as lumm
pseudonymous has quit [Ping timeout: 245 seconds]
montxero has joined #lisp
anewuser has joined #lisp
oni-on-ion has joined #lisp
patlv has joined #lisp
<montxero>
someone has a gun to your head and says, show me a simple example of a macro in under 7 lines! It must be simple enough for a non lisper to understand once some basic rules are explained
<beach>
Does it count to show how some standard macros can be implemented?
<Bike>
prog1, i guess
<montxero>
beach: provided it is simple enough to be groked by a non expert
milanj_ has quit [Quit: This computer has gone to sleep]
<trittweiler>
montxero, how about (defmacro while (condition &body body) ...)? There are many ways you can base the expansion on. Which one depends on your intended pedagogy.
<montxero>
trittweiler: What are the basic rules required to understand this
gabiruh has quit [Read error: Connection reset by peer]
<montxero>
_death: interesting... why not a function? why resort to macros here
<loke>
When I deonstrated macros to a non-Lisp audience I created a reverse-if, basically something that worked like IF but reversed its arguments: (IF C T F) ⇒ (REVERSE-IF C F T)
<Bike>
it's totally different as a function
Kundry_Wag has quit [Ping timeout: 240 seconds]
<Bike>
it lets you do things like (reverse (2 2 +))
<montxero>
beach: The gunslinger cocks the gun... too much stuff to unpack in there
<Bike>
because the macroexpander reverses the (2 2 +) into (+ 2 2)
<beach>
montxero: I don't think you are ever going to be happy with the answer, so I give up.
pseudonymous has quit [Remote host closed the connection]
pseudonymous has joined #lisp
<montxero>
loke: Nice... I will pore over the slide
<montxero>
beach: Nooooo don't give up... you always deliver
patlv has quit [Ping timeout: 256 seconds]
<montxero>
beach: How about this... BANG! now I've shot the tip of your right shoe missing your toes by inches... c'mon gimme one
<beach>
Nah. I think there are plenty of people here who can do it.
<loke>
beach: Have you looked at Axiom?
<beach>
loke: I don't think so. Remind me what it is.
<loke>
beach: It is another CAS, separate from Maxima, although the maintainer of Maxima started the Axiom project as well, back in the 70's or something
kozy has joined #lisp
<beach>
Ah, OK.
<beach>
Is it also written in Lisp?
kozy has quit [Remote host closed the connection]
<loke>
It's still maintained, which is fine (but odd that I didn't know about it). It runs in Common Lisp, but it's written in lterate style (like Knuth does) and it seems as though they actually don't write the code in Lisp, but rather in the Axiom language that is converted to CL.
<beach>
I see.
<loke>
The source files bascially contains the axiom code in comments + the CL code. it seems they pass it through a translator that converts the axiom code in the comments to respective Lisp functions.
<loke>
It's a bit strange, but at the same time perhaps a good example of how you can leverage Lisp to get natively compiled Lisp code even if you use a different language.
<beach>
Yes, I see. Very strange looking.
<loke>
wonder how this is maintained. Dothey write the code in comments, or do they paste the result manually after making modifications?
kozy has joined #lisp
iridioid has joined #lisp
<beach>
Good question.
<loke>
I'm looking at some changes in the git history. The git change records a change to oboth the code in the comment, along with the corresponding Lisp code in the same diff
<loke>
It must be generated from the comments.
<beach>
One hopes.
<makomo>
loke: it uses the literate programming methodology.
<makomo>
it's not that actively maintained though, at least i got that impression
<makomo>
but there's an interesting talk from one of the the authors (and the current maintainer) on literate programming
<makomo>
his name is timothy daly iirc
kerframil has joined #lisp
<makomo>
loke: oh you already mentioned the "literate style", i missed that, sorry :D
<oni-on-ion>
this tripped me out yesterday, it is one of two things ive seen yesterday which really opened my mind and respect for lisp : http://www.lispology.com/show?JHE
patlv has joined #lisp
<beach>
oni-on-ion: That one doesn't take into account the published results that write floating point numbers so that reading it back gives the same exact value.
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
k4rtik has joined #lisp
<beach>
Wow, new-ish paper about that by Aubrey Jaffer. Nice!
Kundry_Wag has quit [Remote host closed the connection]
<loke>
beach: is that a guy's name?
<beach>
You bet.
nanoz has joined #lisp
<beach>
I think he wrote Guile or something like that.
Murii__ has quit [Remote host closed the connection]
python476 has quit [Ping timeout: 265 seconds]
fikka has quit [Ping timeout: 256 seconds]
vlatkoB has quit [Remote host closed the connection]
jasmith has quit [Quit: Leaving]
ebrasca has quit [Read error: No route to host]
ebrasca has joined #lisp
random-nick has quit [Ping timeout: 268 seconds]
xantoz has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
xantoz has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
jasmith has joined #lisp
fikka has joined #lisp
python476 has joined #lisp
lumm_ has joined #lisp
lumm has quit [Ping timeout: 268 seconds]
lumm_ is now known as lumm
fikka has quit [Ping timeout: 248 seconds]
guaqua has quit [Ping timeout: 240 seconds]
gabiruh has quit [Ping timeout: 260 seconds]
guaqua has joined #lisp
patlv has joined #lisp
iridioid has quit [Quit: WeeChat 2.1]
buffergn0me has quit [Ping timeout: 264 seconds]
TCZ has joined #lisp
k4rtik has quit [Ping timeout: 265 seconds]
edgar-rft has quit [Remote host closed the connection]
jason_m has quit [Ping timeout: 265 seconds]
nowhere_man has quit [Ping timeout: 260 seconds]
<stacksmith>
Good day. Could someone explain the difference between sb-walker::env-lexical-variables and sb-c::lexenv-vars ? The latter seems to be stored in the :vars slot of SBCL's environment structure... The former seems to be available only as a predicate sb-walker::var-lexical-p...
<pjb>
Perhaps better on #sbcl
<stacksmith>
indeed.
nowhere_man has joined #lisp
<hjudt>
is there an easy way to remove parts of a string from beginning or end? like say (remove-suffix "-string" "from-my-long-string")?
<stacksmith>
hjudt: if you know the lengths, (subseq ...
<hjudt>
maybe already implemented in some lib?
<hjudt>
stacksmith: that's how i do it atm, but it is a bit awkward to use and to write, a proper wrapper would be nice...
al-damiri has joined #lisp
<didi>
Sometimes I want to iterate over lists inside macros, but I don't want DOLIST NIL block get in the way (because I want to use the NIL block myself). What do you think? https://paste.debian.net/hidden/38c9fc77
<stacksmith>
hjudt: it's one line of code.
graphene has quit [Remote host closed the connection]
patlv has quit [Ping timeout: 264 seconds]
Kundry_Wag has quit [Remote host closed the connection]
graphene has joined #lisp
DGASAU has quit [Ping timeout: 268 seconds]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
Kundry_W_ has joined #lisp
<stacksmith>
did: why not just use LOOP? or mapcar?
<stacksmith>
Or wrap ,@body in its own block?
TCZ has quit [Quit: Leaving]
<didi>
stacksmith: Because, as far as I understand it, LOOP defines a nil BLOCK and I want to avoid MAPCAR function calls. In respect to body's own block, if block calls RETURN, it will still stop at the enveloping nil block.
patlv has joined #lisp
<stacksmith>
That seems to make sense. A minor annoyance is that your body cannot start with declarations because of the setf... which could be moved to follow body - I've also used pop in similar situations... I think it compiles to the same code...
mflem has joined #lisp
varjag has quit [Ping timeout: 265 seconds]
mflem has quit [Client Quit]
jasom has joined #lisp
impulse has quit [Ping timeout: 245 seconds]
impulse has joined #lisp
eli_oat has joined #lisp
<didi>
stacksmith: Ah, true. I'm yet to use this outside macros, and I didn't need to use declarations inside it, tho I've used declarations deep inside these things.