<White_Flame>
and get it to operate similarly without a macro, having the function decide which one to call
<White_Flame>
so the feature set tends to be far easier to use with a macro, but this overall mechanism isn't unattainable with just functions
<White_Flame>
something like (with-open-file (stream "file.txt") ...) creates LET bindings around the body which the body can use lexically, which is probably a step beyond
<White_Flame>
although (with-open-file "file.txt" (list ..options) (lambda (stream) ...)) is conceptually still equivalent
<White_Flame>
*with-open-file2 or something
<White_Flame>
but the simplicity of being able to express exactly what you want, instead of having to construct little parameter APIs and function objects for everything as a burden to the _user_ of the utility, makes macros great for a lot of things
<White_Flame>
basically eliminating boilerplate, and allowing code transformation, injection, and true scoping at will
<White_Flame>
and obviously the function object versions will have higher performance overheads for very simple things than just generating a single code body via macro
frost-lab has joined #lisp
<ziron>
White_Flame: thanks, good stuff!
Alfr has quit [Quit: Leaving]
ziron has quit [Quit: leaving]
galex-713 has joined #lisp
galex-713 has quit [Ping timeout: 240 seconds]
galex-713 has joined #lisp
galex-713 has quit [Ping timeout: 240 seconds]
akoana has left #lisp ["Leaving"]
elusive has joined #lisp
luckless_ has quit [Ping timeout: 240 seconds]
galex-713 has joined #lisp
luckless_ has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
galex-713 has quit [Ping timeout: 252 seconds]
galex-713 has joined #lisp
Alfr has joined #lisp
galex-713 has quit [Ping timeout: 260 seconds]
raeda_ has quit [Quit: Leaving]
random-nick has quit [Ping timeout: 260 seconds]
galex-713 has joined #lisp
imuo has joined #lisp
galex-713 has quit [Excess Flood]
galex-713 has joined #lisp
asarch has joined #lisp
galex-713 has quit [Ping timeout: 252 seconds]
Oddity- has joined #lisp
Oddity has quit [Ping timeout: 258 seconds]
galex-713 has joined #lisp
Oladon has joined #lisp
semz has quit [Ping timeout: 245 seconds]
long4mud has joined #lisp
galex-713 has quit [Quit: No Ping reply in 180 seconds.]
galex-713 has joined #lisp
elusive has quit [Ping timeout: 252 seconds]
semz has joined #lisp
semz has quit [Changing host]
semz has joined #lisp
gaqwas has quit [Ping timeout: 246 seconds]
gaqwas has joined #lisp
gaqwas has quit [Changing host]
gaqwas has joined #lisp
epony has quit [Ping timeout: 240 seconds]
galex-713 has quit [Ping timeout: 240 seconds]
prxq_ has joined #lisp
prxq has quit [Ping timeout: 240 seconds]
aeth has quit [Quit: Reconnecting]
aeth has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
NULLean has quit [Quit: WeeChat 3.0]
Bike has quit [Quit: Lost terminal]
Helmholtz has joined #lisp
sxmx has quit [Quit: WeeChat 3.1]
Alfr is now known as Guest58507
Alfr has joined #lisp
<beach>
Good morning everyone!
Guest58507 has quit [Ping timeout: 250 seconds]
aindilis has quit [Ping timeout: 240 seconds]
sxmx has joined #lisp
Helmholtz has quit [Quit: Helmholtz]
asarch has quit [Quit: Leaving]
asarch has joined #lisp
Oladon has quit [Quit: Leaving.]
toorevitimirp has joined #lisp
Sauvin has joined #lisp
kini has joined #lisp
oxum has joined #lisp
oxum_ has quit [Ping timeout: 260 seconds]
narimiran has joined #lisp
oxum has quit [Ping timeout: 258 seconds]
oxum_ has joined #lisp
<MrtnDk[m]>
Goodmorning beach.
waleee-cl has quit [Quit: Connection closed for inactivity]
mrchampion has quit [Remote host closed the connection]
galex-713 has joined #lisp
galex-713 has quit [Ping timeout: 240 seconds]
galex-713 has joined #lisp
oxum_ has quit [Quit: Leaving...]
imuo has quit [Ping timeout: 240 seconds]
Lord_of_Life has joined #lisp
galex-713 has quit [Ping timeout: 240 seconds]
varjag has joined #lisp
varjag has quit [Ping timeout: 252 seconds]
galex-713 has joined #lisp
waleee-cl has joined #lisp
galex-713 has quit [Ping timeout: 240 seconds]
skapata has quit [Remote host closed the connection]
xsperry has quit [Read error: Connection reset by peer]
cognemo has quit [Quit: cognemo]
cognemo has joined #lisp
hendursaga has joined #lisp
hendursa1 has quit [Ping timeout: 240 seconds]
pve has joined #lisp
datajerk has quit [Ping timeout: 252 seconds]
cage_ has joined #lisp
scymtym has joined #lisp
epony has joined #lisp
datajerk has joined #lisp
galex-713 has joined #lisp
shka_ has joined #lisp
narimiran has quit [Quit: leaving]
VincentVega has joined #lisp
galex-713 has quit [Ping timeout: 240 seconds]
galex-713 has joined #lisp
anticrisis has quit [Read error: Connection reset by peer]
gpiero has quit [Remote host closed the connection]
contrapunctus has left #lisp ["Disconnected: closed"]
VincentVega has joined #lisp
contrapunctus has joined #lisp
IPmonger has joined #lisp
IPmonger has quit [Client Quit]
IPmonger has joined #lisp
zaquest has quit [Quit: Leaving]
zaquest has joined #lisp
nullx002 has joined #lisp
prov has joined #lisp
Nilby has quit [Ping timeout: 258 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
hiroaki has quit [Ping timeout: 240 seconds]
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 240 seconds]
hiroaki has joined #lisp
aartaka_d has joined #lisp
aartaka has quit [Ping timeout: 268 seconds]
White_Flame has quit [Ping timeout: 258 seconds]
mrchampion has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #lisp
<jcowan>
Some time back my private work (on FIGlet) made me the only person who could efficiently do what $EMPLOYER wanted, because I had both knowledge and experience with bitmap fonts.
kevingal has joined #lisp
rpg has joined #lisp
l1x has quit [Quit: Connection closed for inactivity]
aindilis has joined #lisp
Josh_2 has joined #lisp
<Josh_2>
Hey
<Josh_2>
has anyone written a library to downloading fasl files from a server and load them into a running image?
<beach>
jcowan: What's the context?
<beach>
Hello Josh_2.
<phoe>
Josh_2: are you thinking of some sorta compilation server?
<Josh_2>
sorta
<phoe>
and/or cache?
<Josh_2>
uh
<jcowan>
The previous discussion about work stuff vs. hobby stuff.
<phoe>
Josh_2: because I'd solve it on the unix level, via mounting a read-only network directory, and then pointing Lisp to that directory as a cache location
<beach>
jcowan: Ah, OK.
<Josh_2>
Basically I have a project that is going to be deployed in various places soon, I'd like the users to be able to just run something like #.update and the image will grab the latest signed fasls from my server and load them into the image
<jcowan>
Plus I like saying enigmatic things. :-)
<phoe>
oh, so you don't control the clients
<phoe>
I see
<Josh_2>
yeh
<Josh_2>
I don't see why I should stick with the normal means of controlling versions when I can live load code into my lisp image
<Josh_2>
CL can apply patches + add new features without having to be restarted, I think I should leverage this pwoer
<jcowan>
Does anyone understand why ) is a macro character that always raises an exception, rather than an invalid character (which also always raises an exception)?
<Josh_2>
I guess I can just make something :P
louis771 has joined #lisp
<beach>
jcowan: In Common Lisp we don't "raise exceptions", we "signal conditions". The difference is important because the exception system of most programming languages is pale in comparison with the Common Lisp condition system.
<jcowan>
I know that. My question was a substantive one.
<jcowan>
s/raises an exception/signals a condition/
<beach>
jcowan: ) is not always invalid. Not at the end of a list.
<jcowan>
But it's always invalid in the main loop of `read`, which is what the readtable is for. ) is normally processed by read-delimited-list, which doesn't care about the readtable.
<beach>
jcowan: Are you saying READ-DELIMITED-LIST does not call READ when the next character is )?
<beach>
I don't think that is necessarily true.
nullx002 has quit [Ping timeout: 246 seconds]
louis771 has quit [Ping timeout: 265 seconds]
<beach>
As I recall, I designed Eclector so that READ-DELIMITED-LIST would handle the condition that was signaled by READ calling the reader macro for ).
<_death>
jcowan: maybe so you can have |foo )| and better error condition type..
<jcowan>
"read-delimited-list looks ahead at each step for the next non-whitespace[2] character and peeks at it as if with peek-char. If it is _char_, then the character is consumed and the list of objects is returned. If it is a constituent or escape character, then read is used to read an object, which is added to the end of the list. If it is a macro character, its reader macro function is called; if the function returns a
<jcowan>
value, that value is added to the list. The peek-ahead process is then repeated."
<jcowan>
_death: Good point
<beach>
jcowan: I see. Thanks.
<beach>
jcowan: Ah, but ) is a macro character. Let me read that passage.
<jcowan>
Also, I assumed that escaped invalid characters are treated as constituents, but perhaps that is not true
prov has left #lisp ["ERC (IRC client for Emacs 28.0.50)"]
<jcowan>
But the first test is for being eql to _char_, the delimiter.
<beach>
jcowan: Oh, but wait, READ-DELIMITED-LIST can not read dotted lists, so it can't be used directly by the reader macro for (.
<jcowan>
Ah, of course. Thanks.
Helmholtz has joined #lisp
<jcowan>
Missed it by *that* much.
* jcowan
holds two fingers close together
<beach>
What should happen if one does (set-syntax-from-char #\] #\)) and then (read-from-string "(a b c]")?
<beach>
SBCL signals an error, but is that right?
<jcowan>
I think it is; merely copying the syntax does not make ] a true synonym for ).
<beach>
You may be right.
rogersm has joined #lisp
<alanz>
Josh_2, your downloading fasl files things could be done in guix. Or via nix and cachix
<jcowan>
In particular, whatever the reader macro for ( does, it must be looking for a terminator eql to ), not something which happens to have the same (opaque) reader macro as ).
* jcowan
should write reader macros for Interlisp [ and ], just to have fun with the readtable.
<jcowan>
(They mean the same as ( and ), but a ] will implicitly close (s back to the matching [, or the beginning of the outermost sexp if there is no [. The dual is also the case.)
Inline has quit [Ping timeout: 240 seconds]
louis771 has joined #lisp
orivej has joined #lisp
louis771 has quit [Ping timeout: 246 seconds]
louis771 has joined #lisp
rogersm has quit [Remote host closed the connection]
rogersm has joined #lisp
rogersm has quit [Remote host closed the connection]
rogersm has joined #lisp
<VincentVega>
Is there a cl function which can do string substitutions like this: (sub "000" "cd" "abcd1cde") -> "ab0001000e"?
louis771 has quit [Ping timeout: 268 seconds]
<VincentVega>
nvm i just found cl-ppcre:regex-replace-all
gioyik has joined #lisp
curtosis[away] has joined #lisp
<aeth>
VincentVega: If they're the same length and you're actually modifying the sequence, then you can build it fairly easily with REPLACE and SEARCH (a bit harder than that because you want to replace all, though... necessitating iteration). However, in your example, you're allocating a new one and not doing a same-length substitution, so I don't think that that's in the standard.
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
<aeth>
It would still be built starting from SEARCH (or POSITION), but I'm really starting to stretch the definition of "a CL function" to go from a simple combination of two functions to, well, writing an entire algorithm.
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
Helmholtz has quit [Quit: Helmholtz]
<VincentVega>
aeth: Now, that's fine, I don't need in-memory substitution, I am doing a bit of a functional approach, and the replaced strings are of different size. But thanks for the pointers, I can live with cl-ppcre dependency, no big deal.
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
zaquest has quit [Read error: Connection reset by peer]
aeth has quit [Ping timeout: 246 seconds]
zaquest has joined #lisp
aeth has joined #lisp
rogersm has quit [Remote host closed the connection]
Spawns_Carpeting has quit [Read error: Connection reset by peer]
rogersm has joined #lisp
rogersm has quit [Remote host closed the connection]
ukari has quit [Remote host closed the connection]
rogersm has joined #lisp
krid has joined #lisp
imuo has joined #lisp
kslt1 has quit [Quit: leaving]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
nullx002 has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
nullx002 has quit [Read error: Connection reset by peer]
ravndal has joined #lisp
ksierka has joined #lisp
villanella has quit [Ping timeout: 240 seconds]
cosimone has quit [Remote host closed the connection]
srandon111 has joined #lisp
cosimone has joined #lisp
akoana has joined #lisp
VincentVega53 has joined #lisp
frgo has joined #lisp
VincentVega59 has joined #lisp
VincentVega has quit [Ping timeout: 240 seconds]
gioyik has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 246 seconds]
VincentVega53 has quit [Ping timeout: 240 seconds]
frgo has quit [Remote host closed the connection]
VincentVega59 has quit [Ping timeout: 240 seconds]
frgo has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
mindCrime has joined #lisp
galex-713 has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
bgardner has joined #lisp
bgardner has quit [Client Quit]
bgardner has joined #lisp
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
myall has joined #lisp
myall has quit [Changing host]
myall has joined #lisp
Sheilong has joined #lisp
Reggie_ has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
notzmv has quit [Ping timeout: 252 seconds]
Reggie_ has quit [Ping timeout: 268 seconds]
ukari has joined #lisp
Lycurgus has joined #lisp
tyson2 has quit [Ping timeout: 246 seconds]
krid has quit [Ping timeout: 240 seconds]
cosimone` has joined #lisp
cosimone has quit [Ping timeout: 246 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
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
gioyik has joined #lisp
choegusung has joined #lisp
krid has joined #lisp
choegusung has quit [Client Quit]
simendsjo has joined #lisp
cage_ has quit [Quit: Leaving]
simendsjo has quit [Client Quit]
Inline has joined #lisp
louis771 has joined #lisp
epony has quit [Ping timeout: 240 seconds]
imuo has quit [Quit: Connection closed]
metallicus has joined #lisp
Spawns_Carpeting has joined #lisp
<MrtnDk[m]>
Is setf the preferred way to deal with variables in a (loop ...) ? When you loop (tail) recursively, you can use operands ...
<Shinmera>
I have no idea what you're saying.
metallicus has quit [Quit: WeeChat 3.1]
louis771 has quit [Quit: My M1 has gone to sleep. ZZZzzz…]
louis771 has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
Jesin has joined #lisp
cosimone` has quit [Remote host closed the connection]
<phoe>
MrtnDk[m]: depends
cosimone` has joined #lisp
<phoe>
when you (loop ... for ...), you usually do not need to SETF anything
cosimone` has quit [Remote host closed the connection]
<phoe>
when you (loop ... with ...) then you *might* want to SETF these variables because otherwise they stay constant throughout the iteration
<phoe>
unless you want them to stay constant, obviously
<Krystof>
or you could use do*</heretic>
<MrtnDk[m]>
If I loop for i from a to b, I might wanna manipulate some variables, like "sum", which is a sum of the numbers from a to b. (As an example, I know there are better ways to do that).
<MrtnDk[m]>
I don't know, maybe I just need to learn how to think again, in a common lisp way.
<Shinmera>
for sum = i then (+ sum i)
<Shinmera>
often you can do it with sum but sometimes you'll want to setf. I don't know what you expect as an answer to so general a question, really.
<Shinmera>
*with for
<MrtnDk[m]>
Is sum a keyword, or how do you declare it?
<Shinmera>
? it's a variable.
White_Flame has joined #lisp
<MrtnDk[m]>
How do you update/declare it? Maybe I lack some basic common lisp understanding, I'm New. I usually use let or setq
<MrtnDk[m]>
What I'm asking is very general. The way you do loops / iterative programming in CL is new to me. I come from scheme as a beginner in both.
kpoeck has joined #lisp
<Shinmera>
Have you read the LOOP chapter in PCL?
<MrtnDk[m]>
I don't know what PCL is.
supercoven has quit [Read error: Connection reset by peer]
<Shinmera>
minion: tell MrtnDk[m] about pcl
<minion>
MrtnDk[m]: look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
<MrtnDk[m]>
A book called programming in common lisp, I guess?
<MrtnDk[m]>
oh
<MrtnDk[m]>
No, I haven't read anything of that.
<MrtnDk[m]>
Seems like a good resource though.
<MrtnDk[m]>
Shinmera I can find a chapter about loop for black belts, but I would consider myself white belt or perhaps yellow ...
<Shinmera>
well, there's other chapters before it for that.
louis771 has quit [Quit: My M1 has gone to sleep. ZZZzzz…]
curtosis[away] has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
louis771 has joined #lisp
luni has joined #lisp
karlosz has joined #lisp
<MrtnDk[m]>
About loop?
Inline has quit [Ping timeout: 246 seconds]
<Alfr>
There's also tagbody and go for pastafarians.
villanella has joined #lisp
louis771 has quit [Quit: My M1 has gone to sleep. ZZZzzz…]
<MrtnDk[m]>
Shinmera What I meant to ask, was if the chapter for black belts, was the chapter you thinking of.
louis771 has joined #lisp
lowryder has quit [Ping timeout: 265 seconds]
<Shinmera>
yes
<_death>
MrtnDk[m]: earlier chapters also discuss loop, but that chapter goes into depth
<MrtnDk[m]>
ok
<MrtnDk[m]>
Thanks.
lowryder has joined #lisp
frgo has quit []
notzmv has joined #lisp
<_death>
PROG is great for finite spaghetti machines