jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language<http://cliki.net/> logs:<https://irclog.whitequark.org/lisp,http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
kozy has quit [Remote host closed the connection]
kozy has joined #lisp
megalography has joined #lisp
Roy_Fokker has joined #lisp
housel has quit [Remote host closed the connection]
housel has joined #lisp
Sauvin has quit [Ping timeout: 240 seconds]
Nephromancer has quit [Quit: Connection closed for inactivity]
varjag has joined #lisp
<paule32> sodele
<paule32> here you have:
Sauvin has joined #lisp
rumbler31 has joined #lisp
Balooga_ has quit [Quit: Balooga_]
rumbler31 has quit [Ping timeout: 240 seconds]
Fare has joined #lisp
Balooga_ has joined #lisp
pjb has quit [Ping timeout: 264 seconds]
megalography has quit [Ping timeout: 272 seconds]
varjag has quit [Ping timeout: 245 seconds]
jmercouris has joined #lisp
<asarch> What is the keystroke to open multiple files in Emacs?
<jmercouris> asarch: I don't think that's possible
megalography has joined #lisp
<jmercouris> I think it is only possible via dired
<asarch> Thank you
<asarch> Thank you very much :-)
astronavt has quit [Ping timeout: 272 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jack_rabbit has quit [Ping timeout: 252 seconds]
phenoble has quit [Ping timeout: 252 seconds]
thetemplar has quit [Ping timeout: 252 seconds]
phenoble has joined #lisp
makomo has quit [Ping timeout: 260 seconds]
<aeth> asarch: You can open multiple files if you can express them as a wildcard, so C-x C-f ~/your/path/*lisp RET will open all of your lisp files in that directory.
<Blackbeard> aeth: 😱awesome
astronavt_ has joined #lisp
<jmercouris> Assuming you don't have ivy or others...
astronavt__ has joined #lisp
astronavt_ has quit [Read error: Connection reset by peer]
Essadon has quit [Quit: Qutting]
fiddlerwoaroof has joined #lisp
astronavt__ has quit [Ping timeout: 272 seconds]
Balooga_ has quit [Quit: Balooga_]
jealousmonk has quit [Quit: Leaving]
moei has quit [Quit: Leaving...]
moei has joined #lisp
rumbler31 has joined #lisp
Oladon has joined #lisp
Balooga_ has joined #lisp
robotoad has quit [Quit: robotoad]
rumbler31 has quit [Ping timeout: 240 seconds]
robotoad has joined #lisp
Balooga_ has quit [Quit: Balooga_]
Guest25977 has quit [Ping timeout: 260 seconds]
jmercouris has quit [Remote host closed the connection]
siraben has joined #lisp
flazh has quit [Ping timeout: 252 seconds]
lemonpepper24 has joined #lisp
dented42 has joined #lisp
esrse has joined #lisp
kushal has quit [Remote host closed the connection]
kushal has joined #lisp
dddddd has quit [Remote host closed the connection]
dented42 has quit [Ping timeout: 252 seconds]
Balooga_ has joined #lisp
lemonpepper24 has quit [Ping timeout: 260 seconds]
<beach> Good morning everyone!
<no-defun-allowed> Morning beach
<beach> asarch: There is beirc. I am told it needs some maintenance.
Balooga_ has quit [Quit: Balooga_]
Balooga_ has joined #lisp
megalography has quit [Ping timeout: 240 seconds]
dented42 has joined #lisp
flazh has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dented42 has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pierpal has joined #lisp
rumbler31 has joined #lisp
megalography has joined #lisp
ggole has joined #lisp
rumbler31 has quit [Ping timeout: 240 seconds]
Pixel_Outlaw has quit [Quit: Leaving]
Guest25977 has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
Guest25977 has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
dented42 has joined #lisp
dented42 has quit [Client Quit]
Roy_Fokker has quit [Read error: Connection reset by peer]
dented42 has joined #lisp
wigust has quit [Ping timeout: 252 seconds]
Oladon has quit [Quit: Leaving.]
acolarh has quit [Ping timeout: 245 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dented42 has joined #lisp
lemonpepper24 has joined #lisp
acolarh has joined #lisp
ealfonso has quit [Disconnected by services]
ealfonso has joined #lisp
<ealfonso> I feel very insecure whenever I just run into 404s and domain errors when trying to find the website of a recommended CL library
terpri has quit [Ping timeout: 260 seconds]
<|3b|> lots of libs are old, and also lots of links to them :/
flazh has quit [Ping timeout: 245 seconds]
<PuercoPop> ealfonso: the new domain is kpe.io
<PuercoPop> but its been down for a couple of days as least
<|3b|> expired last month :/
<beach> _death: Fixed! Thanks!
<PuercoPop> But you should be able to load clsql from quicklisp regardless of the domain
eschatologist has quit [Ping timeout: 240 seconds]
<ealfonso> PuercoPop thanks, I'll give it a try
rtypo has quit [Ping timeout: 246 seconds]
flazh has joined #lisp
pierpal has quit [Remote host closed the connection]
Bike has quit [Quit: Lost terminal]
dented42 has quit [Read error: Connection reset by peer]
dented42 has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 252 seconds]
dented42 has quit [Read error: Connection reset by peer]
doubledup has joined #lisp
dented42 has joined #lisp
Tordek has quit [Ping timeout: 250 seconds]
dale has joined #lisp
Arcaelyx_ has quit [Quit: Textual IRC Client: www.textualapp.com]
cobax has joined #lisp
<Shinmera> yes
<russellw> cool, thanks
Tordek has joined #lisp
orivej has joined #lisp
Siorai has quit []
<Shinmera> clhs 17.2.1
<specbot> Satisfying a Two-Argument Test: http://www.lispworks.com/reference/HyperSpec/Body/17_ba.htm
<Shinmera> "If neither a :test nor a :test-not argument is supplied, it is as if a :test argument of #'eql was supplied."
vlatkoB has joined #lisp
lemonpepper24 has quit [Ping timeout: 252 seconds]
smokeink has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 272 seconds]
makomo has joined #lisp
igemnace has quit [Quit: WeeChat 2.2]
<paule32> hello
<paule32> good morning @all
<no-defun-allowed> hi paule32
<paule32> have you download the codes?
<no-defun-allowed> no
<paule32> pjb is still sleeping?
cnx has joined #lisp
<no-defun-allowed> wanna find out?
<cnx> hi are optional args evaluated from left to right?
<paule32> haha, bet
<paule32> :-)
<no-defun-allowed> cnx: everything is left to right, so yes
<cnx> i mean the fallback value? across all implementation?
<White_Flame> cnx: and later optional args can refer to the value of prior optional args
<cnx> ie it's always legal to (defun foo (&optional (bar 21) (baz (+ bar 34))) baz)
angavrilov has joined #lisp
<cnx> thanks, and are those fallback evaluated if the param is provided?
<no-defun-allowed> yes
<Shinmera> clhs 3.4.1.2
<specbot> Specifiers for optional parameters: http://www.lispworks.com/reference/HyperSpec/Body/03_dab.htm
<Shinmera> clhs 3.1.2.1.2.3
<cnx> so is it safe, to fallback to big compound data like (make-hash-table)?
<no-defun-allowed> yes, i've done that before
<no-defun-allowed> it's very useful for memoization actually
<cnx> no worries for memory issue?
smokeink has joined #lisp
<cnx> thanks
cnx has left #lisp ["ERC (IRC client for Emacs 26.1)"]
<Shinmera> no-defun-allowed: ??? optional init-forms are not evaluated if the opitonal argument is given
<no-defun-allowed> one moment
<Shinmera> He's already gone (why do people do that?), but: ((lambda (&optional (a (print "a default"))) a) :a)
<no-defun-allowed> i'm thinking of (defun foo (&optional bar (baz bar)) ...) (foo 2)
<no-defun-allowed> baz is 2
<Shinmera> sure
<makomo> morning
<Shinmera> anyway, as I linked (and I'm sure he didn't read) 3.4.1.2 is very clear about this
thetemplar has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 244 seconds]
kajo has quit [Ping timeout: 244 seconds]
orivej has joined #lisp
astalla has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
asarch has quit [Quit: Leaving]
pjb has joined #lisp
<pjb> paule32: but there's no lisp in there!
<no-defun-allowed> yeah paule32 there's no lisp
<no-defun-allowed> hi pjb
<pjb> hi (just passing, I've got a meeting to go to).
<paule32> hi pjb
<paule32> have you success with compiling?
GreaseMonkey has joined #lisp
astalla has quit [Ping timeout: 260 seconds]
<pjb> paule32: Why would I want to compile it? This is #lisp, and there's no lisp code in it!
<pjb> (furthermore, I'm on macOS, I would have to boot a linux box, and I won't have the time today).
thetemplar has quit [Ping timeout: 252 seconds]
<no-defun-allowed> yeah where's the lisp at
housel has quit [Read error: Connection reset by peer]
<paule32> here, in the editor textbox: http://i.imgur.com/eXTW7hm.png
<paule32> :-)
<aeth> "+ 1 2 = 3"
<paule32> wrong?
<aeth> That's just confusing
<White_Flame> I do appreciate that my prior comment was enshrined in the screenshot: https://i.imgur.com/cC3XGdp.png
<aeth> paule32: it should be (+ 1 2) => 3
<aeth> paule32: the infix "result" operator that's used in lisp documentation is "=>" so it isn't confused for a valid lisp function like =
<paule32> ok, it is a fast programming message box
eschatologist has joined #lisp
Balooga_ has quit [Quit: Balooga_]
<paule32> White_Flame: what?
<no-defun-allowed> what the hell is this?
<White_Flame> paule32: in the upper right corner
<adlai> no-defun-allowed: i think paule32 is trying to make an IDE for teaching people how to use nested syntax?
* adlai thought this was done better on the blackboard, last week
<pjb> paule32: why doesn't it work on macOS?
<no-defun-allowed> what the fuck is "+ 1 2"?
<adlai> no-defun-allowed: skinned prefix notation
<no-defun-allowed> i suppose
<adlai> it works as long as there wasn't too much stuff to hold together!
<pjb> paule32: but this is unrelated to your lisp programming problems and your NLP goal.
<pjb> paule32: do you have a problem with this IDE?
<no-defun-allowed> (+ 1 2) should be apply(op+, cons(1,cons(2,nil))) in prefix
<no-defun-allowed> if you want a lisp, sl3.c is fun enough to hack
* adlai should leave this to the professionals
<White_Flame> or you could have fun with polish prefix notation
<White_Flame> which "+ 1 2" might be, with a binary addition operator
<White_Flame> vs "+ + 1 2 3" or "+ 1 + 2 3"
<aeth> Don't confuse paule32
<pjb> adlai: psychiatrist professionals?
<White_Flame> those sorts of parsers are incredibly easy to write, and that's what I thought "+ 1 2 = 3" was implying at first
<aeth> "(+ 1 2) => 3" is the correct way to write it, as you would expect to see it in the hyperspec examples. e.g. http://www.lispworks.com/documentation/HyperSpec/Body/f_pl.htm
<aeth> based on those examples (+) returns 0 and everything else returns 1 or 1.0, though :-p
<aeth> Its examples are very clearly for implementors. Do any of the replacements have a better examples section?
<paule32> White_Flame: sorry, it comes to picture while i chat with #lisp, sorry, don't imagine it
Fare has quit [Ping timeout: 244 seconds]
<paule32> pjb: the ide is Qt5 based, Qt5 is a cross development framework for Mac, Linux, and Windows
<White_Flame> anyway, my quote that was captured on the snapshot is still important to this whole thing as a whole
<aeth> White_Flame: ironic
<adlai> pjb: there was this game i used to play on the toilet, years ago... basically the computer asked the person on the other side of the screen to route a PCB on its behalf. wonderful way to while away a constipated afternoon.
<White_Flame> Flow Free or something?
<adlai> quite possibly!
<White_Flame> I played that tons when recovering from a concussion
<adlai> yeah that's the gaussian integers version :D
<paule32> haha
<adlai> it can get quite frustrating, but then your constipation passes
<paule32> i liked the qbasic game gorrilas on ms-dos
marvin2 has quit [Ping timeout: 252 seconds]
<paule32> [1]> (+ + 1 2) *** - +: NIL is not a number
<no-defun-allowed> checks out
zooey has quit [Ping timeout: 256 seconds]
zooey has joined #lisp
<paule32> Break 1 [2]> (+ (+ 1 2))
<paule32> 3
<no-defun-allowed> also good
random-nick has joined #lisp
cage_ has joined #lisp
<no-defun-allowed> paule32: in common lisp, + at the start of an expression and + in the rest are not equivalent
robotoad has quit [Quit: robotoad]
<no-defun-allowed> (+ ...) refers to the function +, whereas (... + ...) refers to the variable + which is defined by your REPL
<Shinmera> please stop trying to help him, it is not productive. It's been close to two years of this guy getting advice in this channel and not heeding any of it
<no-defun-allowed> alright then
doubledup has quit [Quit: Leaving]
orivej has quit [Ping timeout: 244 seconds]
marvin2 has joined #lisp
xrash has quit [Ping timeout: 246 seconds]
xrash has joined #lisp
dented42 has joined #lisp
shifty has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 244 seconds]
kajo has joined #lisp
mkolenda has quit [Remote host closed the connection]
mkolenda has joined #lisp
whartung has quit [Ping timeout: 246 seconds]
nowhereman_ has joined #lisp
nowhere_man has quit [Ping timeout: 260 seconds]
thetemplar has joined #lisp
amko has joined #lisp
nirved has quit [Ping timeout: 240 seconds]
thetemplar has quit [Ping timeout: 252 seconds]
nirved has joined #lisp
<russellw> If I understand http://www.lispworks.com/documentation/lw50/CLHS/Body/02_dfa.htm correctly, 'x is equivalent to (quote x) but `x is /not/ equivalent to (backquote x) ?
<Shinmera> there is no backquote symbol in the CL package
<russellw> sb-int:quasiquote ... guessing that means sbcl-internal, so the representation is purely an implementation detail?
<Shinmera> yes.
<russellw> okay, thanks
<Shinmera> The representation could be handled by a struct or anything, as long as the readably printed variant uses the standard backquote notation
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
ealfonso has quit [Ping timeout: 252 seconds]
thetemplar has joined #lisp
<White_Flame> the lack of specification also is a problem if you're walking through code in a macro
<White_Flame> there's a fare-quasiquote package which overrides the backquote & comma and ensures it's nice nested sexpr lists for easier traversal
amko has quit [Ping timeout: 272 seconds]
<no-defun-allowed> I have a bad idea which will probably not work portably still.
<no-defun-allowed> (defvar quasiquote (caar '(`(foo))))
<no-defun-allowed> (car '`(foo)) is also possible.
<Shinmera> no-defun-allowed: As I said, it could be a struct or anything
pjb has quit [Remote host closed the connection]
<Shinmera> could even be a data type not specified by CL
<no-defun-allowed> Indeed.
<no-defun-allowed> Hence bad idea and not portable.
pjb has joined #lisp
kajo has joined #lisp
xrash has quit [Ping timeout: 272 seconds]
scymtym has quit [Ping timeout: 252 seconds]
<White_Flame> at least in SBCL, the comma values are not sexprs
<no-defun-allowed> I remember them being sexprs.
<White_Flame> (type-of (second '`,x)) => SB-IMPL::COMMA
<White_Flame> same thing if it's ,(foo bar) or whatever. you'd have to dig into the COMMA object
<no-defun-allowed> Well then, maybe it's a kind of cons situation.
<no-defun-allowed> (cons quasiquote (cons comma x))
<White_Flame> M-.'ing into it, it happens to be a struct
<no-defun-allowed> Oh.
<|3b|> it used to be, but there were too many edge cases when printing them nicely or something like that, so switched to structs
<|3b|> (and if you don't care about printing them nicely, just expand to QUOTE, LIST, APPEND, etc
<russellw> for my purposes, (defconstant +backquote+ (gensym)) etc looks like the way to go
<|3b|> nice printing of ` forms is nice for debugging though
<makomo> this post describes the pretty printing issue http://christophe.rhodes.io/notes/blog/posts/2014/backquote_and_pretty_printing/
whartung has joined #lisp
orivej has joined #lisp
<jackdaniel> when I create a broadcast-stream with s1 and s2: (make-broadcast-stream s1 s2) and call file-position on it, file position of s2 should be returned, right?
<jackdaniel> excerpt from the standard: " The functions file-length, file-position, file-string-length, and stream-external-format return the value from the last component stream."
<|3b|> yeah, that's how i read it
<jackdaniel> thank you
<jackdaniel> (a bit of context: ecl takes first component, so queried for a second opinion that it is wrong)
scymtym has joined #lisp
mkolenda has quit [Remote host closed the connection]
mkolenda has joined #lisp
orivej has quit [Ping timeout: 244 seconds]
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 240 seconds]
Nephromancer has joined #lisp
razzy has quit [Ping timeout: 252 seconds]
cl-arthur has quit [Quit: Lost terminal]
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
thetemplar has quit [Ping timeout: 252 seconds]
rozenglass has quit [Read error: Connection reset by peer]
shka_ has joined #lisp
tfeb has quit [Ping timeout: 245 seconds]
<phoe> What is test-op supposed to do when a test failure happens in modern ASDF and Quicklisp configurations?
<phoe> For example, when Quicklisp builds its systems each month, what should be done to make it know that there was a test failure?
<phoe> Xach: ^
rtypo has joined #lisp
dddddd has joined #lisp
<phoe> ....I'm bamboozled that the CL package has no RETRY restart
<phoe> It's a custom addition!
<oni-on-ion> for CLIM listener and slime and stuff ?
<phoe> yes
<oni-on-ion> does CLHS say something like "would be good idea for implementation [to implement] for debug/trace purpose"
pjb has quit [Ping timeout: 240 seconds]
whartung has quit [Ping timeout: 245 seconds]
tfeb has joined #lisp
dale has quit [Quit: dale]
Roy_Fokker has joined #lisp
tfeb has quit [Ping timeout: 240 seconds]
makomo has quit [Read error: Connection reset by peer]
makomo_ has joined #lisp
tfeb has joined #lisp
<paule32> sodele
<paule32> this is stable arithmetic with integer numbers
nckx has joined #lisp
thetemplar has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
tfb_ has joined #lisp
edgar-rft has joined #lisp
tfeb has quit [Ping timeout: 245 seconds]
igemnace has joined #lisp
<paule32> i have the book paul ghram
<paule32> ansi lisp
<paule32> what are the standard functions, to print text ?
<edgar-rft> (print "text")
fluxit has quit [Quit: ...]
<paule32> hello edgar-rft
<paule32> nice to see you
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
frodef has joined #lisp
<paule32> why is (= 3 3) ;; T
<paule32> why is (= 2 1) ;; nil
<paule32> ?
gector has quit [Ping timeout: 246 seconds]
gector has joined #lisp
<Inline> because = is for numerical comparison
<Inline> 3 = 3 true, 2 = 1 not true
makomo_ has quit [Ping timeout: 245 seconds]
<paule32> i mean in context of T, and nil
<paule32> give it no T, and F ?
<edgar-rft> In Common Lisp nil is false and everything else is true
djuber has quit [Remote host closed the connection]
tfb_ has quit [Remote host closed the connection]
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
igemnace has quit [Quit: WeeChat 2.2]
tfeb has joined #lisp
igemnace has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
makomo_ has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
d4ryus has quit [Quit: WeeChat 2.2]
dueyfinster has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
thetemplar has quit [Ping timeout: 245 seconds]
<paule32> that is cool
tfeb has quit [Ping timeout: 246 seconds]
joga has quit [Ping timeout: 244 seconds]
dueyfinster has quit [Quit: Textual IRC Client: www.textualapp.com]
dueyfinster has joined #lisp
<Demosthenex> _death: any cool tui stuff today?
d4ryus has joined #lisp
shifty has quit [Ping timeout: 246 seconds]
<_death> Demosthenex: yesterday I worked a bit on editor windows like you can see in the second demo.. still there's much more to do there. I think the next step is to add mouse support and moving/resizing windows
<Demosthenex> _death: nice
<_death> there are also some missteps I should fix, added FIXMEs yesterday
rozenglass has joined #lisp
tfeb has joined #lisp
<_death> I'm thinking a small demo application would indeed be something like a "turbo lisp".. with a repl and a file editor
<_death> that incidentally also lets you change itself.. by nature of lisp (and smalltalk..)
tfeb has quit [Ping timeout: 246 seconds]
<Demosthenex> _death: all my usecase is about data entry forms.... i'm tinkering with trying to make some editing widgets
<_death> right.. not there yet
Balooga_ has joined #lisp
makomo_ has quit [Ping timeout: 252 seconds]
<Demosthenex> _death: not laying the burden on you, i'm trying to see what i can come up with. i already got my async inputs and such going
thetemplar has joined #lisp
varjag has joined #lisp
<_death> ;)
housel has joined #lisp
makomo_ has joined #lisp
frodef has quit [Ping timeout: 246 seconds]
tfeb has joined #lisp
<phoe> I have a SBCL thread that just hangs with 100% CPU usage. Its backtrace shows pretty much nothing, https://plaster.tymoon.eu/view/929#929 - how can I debug it?
<phoe> I want to figure out where exactly it is and what it's doing, but a lack of a backtrace makes it pretty hard for me.
<_death> add logging
xrash has joined #lisp
<phoe> _death: hm. It'll be a ton of logs - it's a very intermittent issue.
<phoe> But I guess there's no other option at this point.
nckx has quit [Quit: Updating my GNU GuixSD server — gnu.org/s/guix]
dueyfinster has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
rumbler31 has joined #lisp
nckx has joined #lisp
rumbler31 has quit [Ping timeout: 252 seconds]
<oni-on-ion> phoe: CL has a nice tracer, called..
<oni-on-ion> or what about using 'trace' ?
Pixel_Outlaw has joined #lisp
Oladon has joined #lisp
<phoe> Something very fishy is going on.
<phoe> When I C-c C-c a function, that thread unblocks.
<phoe> Compiling a function happens in a completely separate thread, no?
<oni-on-ion> afaik yep. if repl is 'blocked' for me i can still load/compile
paule32 has quit [Ping timeout: 260 seconds]
<Demosthenex> hrm, i found justification in format, but not how to replace the default padding char while using center ie: (format nil "~70:@<~A~>" "Whee"), but what if i wanted .'s instead of spaces?
<phoe> ~70,'.
<phoe> AFAIR this should work
<Demosthenex> that made it right justified
<phoe> oh, hm
esrse has quit [Ping timeout: 252 seconds]
<Demosthenex> (format nil "~70,,,'.<~A~>" "Whee") made it use .'s and right justified
pjb has joined #lisp
<Demosthenex> i get an error about using options after the @ modifier
<Demosthenex> (format nil "~70,,,'.:@<~A~>" "Whee")
<Demosthenex> that was pretty opaque, the hyperspec realy didn't explain that well
<_death> personally I wouldn't use format here
nowhereman_ has quit [Ping timeout: 240 seconds]
razzy has joined #lisp
Fare has joined #lisp
<Demosthenex> _death: given it can do padding, field limiting, etc, why not?
<Demosthenex> _death: never said it was ideal, just that it's provided.
makomo_ is now known as makomo
<_death> no disagreement here.. it's just cryptic and unlispy
<Demosthenex> oh i certainly agree there ;]
<Demosthenex> though i like the hacky method for outputting csv in a one liner
sabrac has joined #lisp
rumbler31 has joined #lisp
razzy has quit [Ping timeout: 245 seconds]
rumbler31 has quit [Ping timeout: 244 seconds]
<Demosthenex> hrm, wasn't there a way to bind slots locally like destructuring-bind?
<makomo> WITH-SLOTS?
<makomo> clhs with-slots
<makomo> and also
<makomo> clhs with-accessors
<Demosthenex> well crap, i was looking for bind-slots :P
<Demosthenex> thanks
<makomo> :-)
<makomo> _death: that's a very nice article, but what about issues regarding localization?
<makomo> for example, the same problem shows up in C++. you can either use iostreams and its text formatters, or you can use printf
Oladon has quit [Quit: Leaving.]
<makomo> it's much easier to localize a printf/format-like "template", rather than individual parts of something like the article's OUT
<makomo> because the translator has more context
steiner has joined #lisp
<makomo> maybe this is just a tooling issues, i don't know
<makomo> issue*
scymtym has quit [Ping timeout: 260 seconds]
<_death> makomo: with Lisp you can store forms.. also, format control strings don't solve the localization problem.. but personally I don't care for localization so..
<Demosthenex> is there a conflict using multiple-value-bind inside the body of a with-slot?
<_death> makomo: in fact with an OUT like construct you can provide more hints that can help with localization.. since you construct a language for writing things
<_death> instead of being limited to the low level format control language that perhaps lets you do something like ~/
<Demosthenex> https://bpaste.net/show/e9cd7a55a1e5 window and title in the first call to locked-write-string-at-point aren't found
<_death> the second argument to with-slots should be the object
<Demosthenex> derp, i thought i fixed that from my test in slime. :P
nowhereman_ has joined #lisp
robotoad has joined #lisp
nowhereman_ has quit [Ping timeout: 252 seconds]
<_death> just to show an example of OUT hackery https://gist.github.com/death/4e273d14e671a3c64f3be10cab2aa1b2
jsjolen has joined #lisp
razzy has joined #lisp
nowhereman_ has joined #lisp
<pjb> _death: makomo: well, there's one way FORMAT helps solving the localization problem.
<pjb> _death: makomo: it's with the format specifier ~*, which allows you to use the arguments by index, instead of by order, so you can easily use format string in different languages, without changing the program and the order of the arguments. In different languages, the order for formating of various data elements into the language often changes.
<_death> instead of comparing to lesser languages, why not compare to a lispy language for solving the localization problem
nowhereman_ has quit [Ping timeout: 260 seconds]
<pjb> (format t (get-localized 'qualified-object-format-string) object color size qualifier) -> "La petite balle bleu" "The small blue ball"
<pjb> French: "~2@*~A ~0@*~A ~A" English: "~2@*~A ~1@*~A ~0@*~A" etc.
<pjb> It is funny, because one of the most advanced localization system, ie. NeXTstep/Openstep/Cocoa's one, isn't even able to do that!
<pjb> lame.
<_death> now instead come up with a lispy grammar for describing it.. (:object ball :definite t :adjectives (small blue))
SumoSud0 has quit [Quit: 8y3 8y3]
cage_ has quit [Quit: Leaving]
lavaflow has joined #lisp
SumoSud0 has joined #lisp
<makomo> _death: well, true, it doesn't solve it by itself, but it's much easier for a translator (the actual person doing the translations) to get context about what's being translated
<makomo> at least that's what i remember reading somewhere
<pjb> _death: the problem is not the lispy grammar. It's to localize the strings.
<makomo> _death: that's a cool example, thanks
<_death> a format control string doesn't give much context for the translator
<_death> which sometimes makes for bad translations in big programs
<makomo> _death: well, that horror from the article sure doesn't. but consider something like "there are ~a objects in the bag" or something
<makomo> or "there are %d objects in the bag"
<_death> 1
<makomo> instead of separate strings "there are" and "objects in the bag"
<_death> now your string is bad
<makomo> right, that also needs to be handled
<makomo> but aside from that
<_death> no, that's the point.. the "use format strings for localization purposes" is just an opportunistic hack.. in lesser languages, it's easy to externalize strings, so they get used and a translator has to work with that
<makomo> _death: what's constantia btw? your own library?
<_death> but printf, format, etc. wasn't designed with localization in mind
<_death> so if you actually want to solve the problem, you find that you need more context and structure
<_death> and an OUT operator can provide that
<makomo> well, it sure is a hack, but i'm not aware of any other approaches
frodef has joined #lisp
<TMA> there is more to localization than simple exchange of strings. -- consider that you need to adjust sizes (an "OK" can be much smaller than "Budiz"); there are other directions for text than ltr-ttb; you might want to adjust colors (because of the connotations) images and icons, ...
<_death> right.. so in the end it's (out (:l10n :there-are-n-objects-in-the-bag n)) ;)
<russellw> Is there a way to get CCL to exit when a script is finished? wx86cl -Q -b -l test.lisp doesn't do it
<Demosthenex> i saw ~?, but was there a way use a variable in the same format string to dynamically change padding?
random-nick has quit [Read error: Connection reset by peer]
<pjb> _death: of course, you would write(format t (_ "format ~A etc" "The message printed when so and so") …) and (format nil (_ "format ~A etc" "The label of the button to do this and that") …)
<pjb> But this is the 101 of localization.
<pjb> and independent of the language. I
<Shinmera> Demosthenex: sure, eg (format T "~va" 10 :woah)
<pjb> only spoke about the specific advantages of lisp format in localization.
<Demosthenex> Shinmera: i read that hyperspec several times and never saw v :P
<Demosthenex> Shinmera: thanks :P
<Shinmera> clhs 22.3
ealfonso has joined #lisp
<Shinmera> "In place of a prefix parameter to a directive, V (or v) can be used. In this case, format takes an argument from args as a parameter to the directive. The argument should be an integer or character. If the arg used by a V parameter is nil, the effect is as if the parameter had been omitted. # can be used in place of a prefix parameter; it represents the number of args remaining to be processed. When used
<Shinmera> within a recursive format, in the context of ~? or ~{, the # prefix parameter represents the number of format arguments remaining within the recursive call."
<pjb> And for the desesperate cases, don't forget ~/
<pjb> you can provide or let the translator provide a set of functions to do the exact formating required in strange languages.
<pjb> makomo: "there are ~a objects in the bag" is not correct.
<makomo> pjb: yeah, i know, it's a really trivial and dumb example
<_death> pjb: like I said, the format control language is low level and barely extensible via ~/ ~? etc.
<pjb> makomo: in CL, we'd write: (loop for i below 3 collect (format nil "There are ~a object~:*~P in the bag." i)) #| --> ("There are 0 objects in the bag." "There are 1 object in the bag." "There are 2 objects in the bag.") |#
<_death> pjb: instead you can use the full power of lisp to make things easier to the (since "localization is more than translation" argument was made) localization mechanical turk
<makomo> pjb: in CL, and in English :D
<_death> pjb: "are"
<Blackbeard> hello
<Blackbeard> I have this code
<shka_> and?
<Blackbeard> is there a way that I can pass just a list '(".jpg" ".png" ".svg") and will apply search to f with every element of the list
<Blackbeard> instead of having so many repetitions of search
<_death> clhs some
<shka_> yup
<shka_> this way is fine though
ealfonso has quit [Disconnected by services]
<shka_> in this case
<_death> but here SEARCH isn't the right tool.. instead you can use PATHNAME-TYPE
anewuser has joined #lisp
<Blackbeard> _death (IRC): ohh !!
<_death> otherwise foo.jpg.exe may be considered an image...
<pjb> _death: right. :-) (loop for i below 3 collect (format nil "There ~[are~;is~;are~] ~:*~a object~:*~P in the bag." i)) #| --> ("There are 0 objects in the bag." "There is 1 object in the bag." "There are 2 objects in the bag.") |#
<pjb> try to do that in C!
<_death> pjb: so now you have this "~[are~;is~;are~]" inline.. but it's a useful thing to have named
<_death> pjb: format control language doesn't give you much to abstract it
<_death> pjb: and it really shouldn't, since stuffing everything into a string makes things cryptic
<pjb> (loop for i below 3 collect (format nil "There ~/english-verb-conjugate/ ~0@*~a object~:*~P in the bag." i "to be"))
<pjb> actually, with ~V/.../ since ~/ cannot take more than one argument.
<pjb> you need to pass i as a parameter.
<_death> pjb: right, now consider ~{ which is limited to lists
<Blackbeard> _death (IRC): thanks!
<_death> pjb: you switched to vectors.. now what ~/{-FOR-VECTORS/ ?
<pjb> That's why you can pass a function as format-string!
<pjb> (format t (smart-formatter "…") …)
<pjb> You cannot anything against format, it's too customizable for that.
<_death> pjb: ok.. now instead just do (smart-formatter "...")
<pjb> smart-format you mean. No.
<_death> pjb: rename it OUT.. even make it use FORMAT to save a bit of code
<pjb> You want to integrate with the existing mechanisms.
paule32 has joined #lisp
lemonpepper24 has joined #lisp
<TMA> you do not want to rely on format's English support too heavily for localization. ~P works ok-ish for English but not for other languages
<pjb> Yes, it's only to generate log messages and debugging statements.
<_death> it's true that error/etc. are burdened with format.. there's even simple-condition with :format-control and :format-arguments.. I use format here and there and when I don't want to depend on constantia.. but when things get too cryptic, I'll either use OUT or just Lisp with simple primitives
<TMA> and even in English you would have hard time to use ~P on regular basis for e.g. ox
thetemplar has quit [Ping timeout: 260 seconds]
<_death> "You have ~D copies of Emacs~:(P running"
<_death> oof, ruined that joke.. -copied of
<pjb> (loop for i below 3 collect (format nil "You have ~D cop~:*~@P of Emacs ~:(P running~)" i)) #| --> ("You have 0 copies of Emacs P Running" "You have 1 copy of Emacs P Running" "You have 2 copies of Emacs P Running") |#
charh has joined #lisp
rumbler31 has joined #lisp
paule32 has quit [Ping timeout: 252 seconds]
random-nick has joined #lisp
<russellw> I'm about to write a function to return the last element of an array. Obviously this is a very simple function, sufficiently so that it probably already has a common name. The most obvious name is array-last; is that's what it's usually known as?
<pjb> russellw: how do you define the last element of #3A((((1 2 3) (4 5 6)) ((1 2 3) (0 0 0))) (((1 2 3) (4 5 6)) ((1 2 3) (0 13 42)))) ?
<pjb> (just to be sure).
<russellw> I don't :)
<pjb> Otherwise, there's (alexandria:last-elt #(1 2 3 4)) #| --> 4 |#
<russellw> ah! thanks
rumbler31 has quit [Ping timeout: 244 seconds]
<pjb> russellw: the problem is not that array, it's that you don't know how to define the last element of that array!
jsjolen has quit [Remote host closed the connection]
<russellw> I'm not planning to use it on multidimensional arrays :)
<pjb> (defun last-element-of-array (a) (row-major-aref a (1- (reduce (function *) (array-dimensions a))))) (last-element-of-array #3A((((1 2 3) (4 5 6)) ((1 2 3) (0 0 0))) (((1 2 3) (4 5 6)) ((1 2 3) (0 13 42))))) #| --> (0 13 42) |#
<pjb> russellw: that's beside the point. The point is that you asked for the last element of an array, not the last element of a vector or of a sequence.
<pjb> russellw: my point is that if you are able to state clearly your requirements, then the code will generally follow easily.
<pjb> russellw: alternatively, you could start speaking in lisp. and ask, How do I (defun last-element (x) (aref x (1- (length x))))? Oops, I answered in the question…
<Shinmera> pjb: array-total-size would be a bit shorter and idiomatic than reducing array-dimensions.
<pjb> russellw: sometimes, you don't know what english name to give to a function. Just start writting it: (defun foo (…) …) and once it's written you can usually find easily what to call it in english.
<pjb> Shinmera: exact.
<pjb> Also, for vectors, you can use length or (array-dimension v 0): you won't get the same result on vectors with fill-pointers.
<pjb> (array-dimension v 0) or array-total-size.
<russellw> pjb, er, if we are going to get snarky about exact wording, take a look at the question I asked, in which I observed that I have no difficulty writing the function; that part is very simple. I merely wanted to know whether it already had a common name. The answer to which was yes, thank you
lemonpepper24 has quit [Ping timeout: 260 seconds]
<Blackbeard> (defun is-imagep (file)
<Blackbeard> (let ((f (pathname-type file)))
<Blackbeard> (some #'equal '("jpg" "jpeg" "png""svg") `(,f))))
<Blackbeard> _death (IRC): looks better now :)
<pjb> russellw: I didn't want to get snarky. In this case, I would have said that obviously, a function to return the last element of an array should be named last-element-of-array.
<pjb> Blackbeard: don't mix is- with -p. They're two different conventions for the same thing.
<pjb> Blackbeard: in lisp, p or -p is prefered.
<_death> (member (pathname-type file) '(...) :test #'equal) ;; or equalp..
<russellw> pjb, ah! Okay, while that's a little verbose for my tastes, it is a perfectly fair answer
<pjb> russellw: you can stylistically choose: array-last-element. Or vector-last-element. Or just last-element, notably if that applies to sequences.
<pjb> russellw: or you can write it as a generic function and have implementations for all kinds of collections.
<russellw> (defun last-elt (s) (elt s (1- (length s)))); one of the things I like about dynamic languages is you get some degree of genericity for free
<pjb> Blackbeard: member is nice. I often prefer to use FIND or even POSITION (for the side effect of computing the position if needed).
<pjb> Blackbeard: member returns a tail of the searched list, so it may be ugly when printed (but otherwise, perfectly ok for the program).
nowhereman_ has joined #lisp
<pjb> Blackbeard: FIND has the advantage of returning the element in the list, as a prototypal form. This can be useful, if you want to normalize them.
<pjb> Blackbeard: also, testing for the file type is a bad idea. You could check the meta data (prefixp "image/" (Content-Type file)). Or check the contents. (But this may require more I/O and computation).
dale has joined #lisp
<pjb> In any cases, be prepared to have non image file names .jpg or something else, and to have png files named .jpg and vice versa.
<_death> you may also want to parse-native-namestring at the edges
thetemplar has joined #lisp
<aeth> russellw: You are probably going to have to inline it to get good performance with it, though. (1) trivial, (2) no reason to redefine it, (3) works on arrays or numbers (here, arrays). So it's a good candidate for inlining.
<aeth> That's just (declaim (inline foo)) right above the defun
<Blackbeard> pjb _death (IRC) ohhh I see let me change it !! thakns :)
<aeth> s/works on arrays or numbers/works generically on arrays or sequences or numbers/
<_death> if you care about performance with lists you'd need another variant
moei has quit [Quit: Leaving...]
<aeth> _death: Yes, if you wanted it to work on lists instead of 1D arrays (vectors) specifically, the ELT variant is bad. You would probably want an ETYPECASE to split it into two cases, one for lists and one for vectors. The compiler will probably optimize it out if it's inline
<russellw> Right, in this case performance is not an issue, but will keep those considerations in mind if it becomes so
<aeth> The important thing is that anything that's just a one liner with something like AREF (works on all arrays) or ELT (works on all sequences) or + (works on all numbers) can become a lot more efficient when inline.
shka_ has quit [Quit: Konversation terminated!]
<_death> aeth: to keep it generic, you can just have (if (listp ...) (car (last ...)) (elt ...)) remember that type sequence is not necessarily type (or list vector)
<_death> not sure what numbers have to do with it
<Blackbeard> I am writing a module to change and set wallpapers for stumpwm
<Blackbeard> it is something very simple,
<Blackbeard> it is my first module of common lisp ever :)
<pjb> That's because in (elt x (1- (length x))), we have to walks of a list. But only 2 O(1) accesses for vectors.
<Blackbeard> my idea was to have a directory with a bunch of images
<aeth> _death: I'd do it like this: (defun last-elt* (sequence) (etypecase sequence (list (car (last sequence))) (sequence (elt sequence (1- (length sequence))))))
<Blackbeard> and I was writing the function to get all the images with (directory path)
<_death> aeth: right, that's good too
<Blackbeard> but your idea is better because I would be able to get images from more paths
<fiddlerwoaroof> Blackbeard: That's a good way to start: assume that everything in the directory is an image and let the user pick one of them then, once you get that working, worry about filtering out non images.
<aeth> _death: numbers and sequences behave very similarly for this sort of pattern
<fiddlerwoaroof> And/or supporting more paths
<Blackbeard> now I just need to get the mimetypes
<_death> aeth: how?
<aeth> _death: Numbers also have an efficient inline form that the compiler will generate (probably... obviously stuff like JSCL behave differently) if it has more type information
<_death> aeth: I see.. you're talking about inline, not last-elt
<aeth> _death: e.g. (defun foo () (last-elt* (vector 1 2 3))) is about half the size in disassemble as last-elt* is if you inline last-elt*
<aeth> And (defun bar () (last-elt* '(1 2 3))) and (defun baz () (last-elt* #(1 2 3))) are compiled to constantly return 3 in SBCL
angavrilov has quit [Remote host closed the connection]
<Blackbeard> I don't find any mimetype function for common lisp
<Blackbeard> fiddlerwoaroof (IRC): oh ok :)
<Blackbeard> I was thinking of using something like this
<Blackbeard> (stumpwm:run-shell-command "file --mime-type image.jpg" t)
nowhereman_ has quit [Ping timeout: 260 seconds]
nowhereman_ has joined #lisp
<fiddlerwoaroof> that would work, you might try this: https://github.com/Shinmera/trivial-mimes
<Blackbeard> fiddlerwoaroof (IRC): ohh thanks!!
<fiddlerwoaroof> It's in quicklisp
<Blackbeard> so i have to do (quicklisp:quickload "trivial-mimes") right
<fiddlerwoaroof> Yeah
<fiddlerwoaroof> If you have a .asd file for your module, you could put the dependency there
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
<Blackbeard> ah g reat!
nowhereman_ has quit [Ping timeout: 252 seconds]
<Blackbeard> :)
anewuser has quit [Ping timeout: 272 seconds]
anewuser_ has joined #lisp
ggole has quit [Quit: ggole]
rumbler31 has joined #lisp
orivej has joined #lisp
shka_ has joined #lisp
rumbler31 has quit [Ping timeout: 244 seconds]
Oladon has joined #lisp
dale has quit [Quit: dale]
<russellw> I want to search a string for the position of the first character that is not a digit. Which function should I be looking at?
scymtym has joined #lisp
<_death> (position-if (complement #'digit-char-p) string)
<russellw> thanks!
<_death> position-if-not is also acceptable
dale has joined #lisp
thetemplar has quit [Ping timeout: 252 seconds]
<random-nick> why isn't there a macro version of the ` reader macro
aydio has joined #lisp
nowhereman_ has joined #lisp
<oni-on-ion> ehhh 'common-lisp-user:function-value' is not defined ?!
<oni-on-ion> random-nick: SB-IMPL::BACKQUOTE-CHARMACRO
<oni-on-ion> use emacs M-. to jump to that definition too
Fare has quit [Ping timeout: 252 seconds]
trittweiler has quit [Ping timeout: 244 seconds]
nly has joined #lisp
trittweiler has joined #lisp
shka_ has quit [Ping timeout: 240 seconds]
aydio has quit [Quit: WeeChat 2.2]
vlatkoB has quit [Remote host closed the connection]
random-nick has quit [Read error: Connection reset by peer]
trittweiler has quit [Ping timeout: 260 seconds]
moei has joined #lisp
Oladon has quit [Quit: Leaving.]
trittweiler has joined #lisp
TMA has quit [Ping timeout: 260 seconds]
<phoe> Using usocket, how can I check if a server socket (made using socket-listen) has been closed or not?
terpri has joined #lisp
nly has quit [Read error: Connection reset by peer]
<phoe> ...I assume it no longer has a local port in that case, and errors when I attempt to fetch it.
<oni-on-ion> usocket docs say to read from the socket and END-OF-FILE is signalled
<phoe> oni-on-ion: I mean a server socket.
<phoe> It does not have any associated stream that I can check for EOF.
<oni-on-ion> same
<oni-on-ion> oh
<oni-on-ion> not sure then
Nephromancer has quit [Quit: Connection closed for inactivity]
<grobe0ba> thats an easy one. assume all traffic can consist of no more than 1024KB and that the stream is defunct after that much traffic has passed. :P
<phoe> grobe0ba: ...
<phoe> I mean a server socket.
<phoe> It does not have any associated stream that I can check for EOF.
<phoe> A server socket's only role is accepting incoming connections and spawning stream sockets that *have* streams and *can* be used to transmit data.
<phoe> I really hate the fact that a socket can close at any moment and because of this, at any moment while handling it, I can get an assortment of very non-portable errors such as sb-bsd-sockets:bad-file-descriptor-error.
terpri has quit [Ping timeout: 252 seconds]
<_death> I don't understand.. if you have a socket created by socket-listen, it will get closed when you close it.. it is possible that socket-accept will return an error
<phoe> No no, my last comment is about stream sockets
<phoe> Server sockets themselves are pretty nice and polite.
<_death> do you mean a socket created by socket-accept?
<phoe> yes, socket-accept creates a stream socket
anewuser_ has quit [Read error: Connection reset by peer]
<_death> then you're supposed to define a state machine and handle client shut down as well as errors
<phoe> Yes, I know that one
<phoe> I just dislike the fact there's multiple conditions that I need to handle
<phoe> And I want to avoid handler-case'ing ERROR because this one captures way too much
<_death> well, sockets are similar to threads in that they're usually not a convenient level for an application to do things
<phoe> that's why I'm working on an abstraction now.
<phoe> sleep time for me - good night
<_death> night
anewuser_ has joined #lisp
<_death> usocket defines its own condition types.. and socket-error's description is "Parent error for all socket related errors"
xrash has quit [Ping timeout: 245 seconds]
<phoe> _death: I wish it would catch all of them. (:
xrash has joined #lisp
bgavran has joined #lisp
terpri has joined #lisp
varjag has quit [Ping timeout: 260 seconds]
anewuser_ is now known as anewuser
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
Oladon has joined #lisp
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
<alandipert> is there a way to set the function cell of a symbol locally? ie i have a function that returns a function, and i want to call that returned function in calling code w/out funcall
terpri has quit [Ping timeout: 246 seconds]
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
rumbler31 has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
<_death> you can have a with-functions macro that expands to labels
tfeb has quit [Client Quit]
<_death> it doesn't set the symbol's function cell.. if you want that, there's setf (and you can define letf..)
<alandipert> i don't think i need that.. just want to avoid funcall inside a let binding
<alandipert> err, let body
<alandipert> a macro sounds good, thanks _death
rumbler31 has quit [Ping timeout: 244 seconds]
<fiddlerwoaroof> alandipert: it took me a while, but I eventually came to appreciate funcall, it eliminates a whole class of errors where a local symbol binding accidentally shadows the function you want to run.
frodef has quit [Ping timeout: 240 seconds]
<fiddlerwoaroof> One way, though, to avoid using funcall all over the place is to define a bunch of combinators to help build up the function you want and then funcall the resulting lambda
<fiddlerwoaroof> (ignore the "lens" part... I started this project with a different plan than what it ended up being :) )
adam4567 has joined #lisp
<pjb> alandipert: perhaps you want flet or labels?
<pjb> ie. not modifying the function cell, but defining a local lexical fbinding?
<pjb> alandipert: setting the function cell is quite problematic. While you can do that to simulate dynamic binding, for functions it's also global to the image, not local to the current thread. So it can easily break hard.
<pjb> alandipert: furthermore, to have good effects, you need to declare that function notinline.
<pjb> (actually, that symbol).
paule32 has joined #lisp
graphene has joined #lisp
<alandipert> i could be braindamaged, https://gist.github.com/alandipert/9d7ff35952f33b3105f90f24a5103e48 is my usecase
<_death> with-collect is also a macro seen in the wild
<_death> there's even a system called "collectors", apparently
graphene has quit [Remote host closed the connection]
<_death> alandipert: by the way, you don't need the sentinel.. you can have &optional (item nil item-supplied)
graphene has joined #lisp
<alandipert> _death oh cool, item-suppied is t then if it was?
<pjb> alandipert: check comment on your gist.
<_death> alandipert: without checking the clhs, don't know.. I'm guessing it specifies that it's "true"
<pjb> Of course, if you need it several times, you can wrap them in a with-collect macro.
<_death> clhs 3.4.1.2
<specbot> Specifiers for optional parameters: http://www.lispworks.com/reference/HyperSpec/Body/03_dab.htm
PyroLagus has joined #lisp
Balooga_ has quit [Quit: Balooga_]
<pjb> Note that optional parameter will probably be slower than mandatory parameters, so it may be worth it to avoid them in inner (and local) functions.
lemonpepper24 has joined #lisp
mutenewt has joined #lisp
shifty has joined #lisp
<pfdietz> And less self-documenting/extensible than keyword parameters.
Balooga_ has joined #lisp
siraben has quit [Ping timeout: 252 seconds]
siraben has joined #lisp
makomo has quit [Ping timeout: 252 seconds]
mutenewt has quit [Quit: Leaving]