jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
<phoe> Alfr: yeah but then there's (standard-function arg1 arg2 #+myimpl arg3) sort of stuff
<Alfr> phoe, right, didn't think of that. :D
random-nick has quit [Ping timeout: 256 seconds]
<ldb> status report: compiled about 600 pages, stuck
<ldb> ok I compiled successfully
<ldb> I need further work to adjust font
Devon has quit [Ping timeout: 260 seconds]
morganw has quit [Remote host closed the connection]
louis77 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ttree has joined #commonlisp
perrierjouet has joined #commonlisp
NotThatRPG has joined #commonlisp
waleee has quit [Ping timeout: 260 seconds]
pve has quit [Quit: leaving]
tevo has quit [Read error: Connection reset by peer]
tevo has joined #commonlisp
<ldb> CLtL2, aka Common Lisp the Language 2nd Edition, the corrected PDF is available as https://ldbeth.sdf.org/clm.pdf
<ldb> all produced from original LaTeX source, compiled with LaTeX 2.09
<ldb> the correction is only the text overflow in the originally available DVI/PS file.
karlosz has quit [Quit: karlosz]
perrierjouet has quit [Quit: WeeChat 3.8]
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
epony has quit [Remote host closed the connection]
<nyx_land> Shinmera: congrats on the kandria release!
perrierjouet has joined #commonlisp
waleee has joined #commonlisp
epony has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
waleee has quit [Ping timeout: 246 seconds]
<NotThatRPG> ldb: That looks great! Thanks for doing that! I still have a copy -- my third, I think -- but like the previous ones the spine is splitting because there are so many pages in a perfect binding.
waleee has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has quit [Ping timeout: 255 seconds]
lisp123 has quit [Remote host closed the connection]
<ldb> I'm trying to figure out how the index were generated, and include them later
NotThatRPG has joined #commonlisp
augendredoubt has quit [Ping timeout: 260 seconds]
pdietz has joined #commonlisp
notzmv has quit [Ping timeout: 255 seconds]
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hineios4 has joined #commonlisp
hineios has quit [Ping timeout: 260 seconds]
hineios4 is now known as hineios
hineios4 has joined #commonlisp
hineios has quit [Ping timeout: 252 seconds]
notzmv has joined #commonlisp
hineios has joined #commonlisp
hineios4 has quit [Ping timeout: 252 seconds]
lisp123 has joined #commonlisp
hineios4 has joined #commonlisp
hineios has quit [Ping timeout: 268 seconds]
hineios4 is now known as hineios
lisp123 has quit [Ping timeout: 272 seconds]
tyson2 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
hineios5 has joined #commonlisp
hineios has quit [Ping timeout: 268 seconds]
hineios5 is now known as hineios
lisp123 has quit [Remote host closed the connection]
ldb has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
hashfunc has joined #commonlisp
azimut has quit [Ping timeout: 255 seconds]
Fredokun has joined #commonlisp
alfonsox has joined #commonlisp
Fredokun has quit [Ping timeout: 252 seconds]
igemnace has joined #commonlisp
mingus has joined #commonlisp
_cymew_ has joined #commonlisp
_cymew_ has quit [Ping timeout: 255 seconds]
rgherdt has joined #commonlisp
lisp123 has joined #commonlisp
dcb has left #commonlisp [MSN Messenger 3.8]
kenran has joined #commonlisp
mingus1 has joined #commonlisp
mingus has quit [Ping timeout: 255 seconds]
mingus1 is now known as mingus
kenran has quit [Remote host closed the connection]
Cymew has joined #commonlisp
<Shinmera> nyx_land: thanks
aartaka has joined #commonlisp
pve has joined #commonlisp
KaitoDaumoto has quit [Ping timeout: 260 seconds]
hashfunc has quit [Remote host closed the connection]
louis77 has joined #commonlisp
hashfunc has joined #commonlisp
Cymew has quit [Read error: No route to host]
hashfunc has quit [Ping timeout: 246 seconds]
shka has joined #commonlisp
Fredokun has joined #commonlisp
MajorBiscuit has joined #commonlisp
hashfunc has joined #commonlisp
Cymew has joined #commonlisp
louis77 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hashfunc has quit [Ping timeout: 260 seconds]
Cymew has quit [Ping timeout: 260 seconds]
louis77 has joined #commonlisp
random-nick has joined #commonlisp
Krystof has joined #commonlisp
ttree has quit [Ping timeout: 272 seconds]
lisp123 has quit [Remote host closed the connection]
hashfunc has joined #commonlisp
lisp123 has joined #commonlisp
hashfunc has quit [Ping timeout: 256 seconds]
hashfunc has joined #commonlisp
seletz_ has joined #commonlisp
seletz has quit [Ping timeout: 246 seconds]
<splittist> ldb: very cool. The tabulated tables (if you see what I mean) on eg labeled pages 558/559 of the pdf are more ragged than the ones on e.g. page 563 of the physical edition. The index is vital to be able to find references to aadvarks and warm fuzzy feeling, for example. (:
<louis77> ldb I think I missed the link, can you repost?
prokhor has quit [Remote host closed the connection]
mrcom_ has joined #commonlisp
mrcom has quit [Read error: Connection reset by peer]
hashfunc has quit [Remote host closed the connection]
chrcav has quit [Ping timeout: 252 seconds]
chrcav has joined #commonlisp
aartaka has quit [Ping timeout: 265 seconds]
aartaka has joined #commonlisp
hashfunc has joined #commonlisp
lisp123 has quit [Ping timeout: 272 seconds]
frgo has quit [Ping timeout: 260 seconds]
hashfunc has quit [Ping timeout: 255 seconds]
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
seletz_ has quit [Ping timeout: 260 seconds]
rgherdt has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
seletz has joined #commonlisp
pdietz has quit [Quit: Client closed]
hashfunc has joined #commonlisp
hashfunc has quit [Ping timeout: 260 seconds]
Cymew has joined #commonlisp
hashfunc has joined #commonlisp
hashfunc has quit [Ping timeout: 260 seconds]
Cymew has quit [Ping timeout: 246 seconds]
azimut has joined #commonlisp
aartaka has quit [Ping timeout: 272 seconds]
aartaka has joined #commonlisp
lisp123 has joined #commonlisp
hashfunc has joined #commonlisp
hashfunc has quit [Ping timeout: 260 seconds]
mingus has quit [Quit: mingus]
mingus has joined #commonlisp
hashfunc has joined #commonlisp
tevo has quit [Read error: Connection reset by peer]
tevo has joined #commonlisp
hashfunc has quit [Ping timeout: 252 seconds]
jeosol has joined #commonlisp
hashfunc has joined #commonlisp
hashfunc has quit [Ping timeout: 255 seconds]
tyson2 has joined #commonlisp
Cymew has joined #commonlisp
mingus1 has joined #commonlisp
mjoerg has joined #commonlisp
mingus has quit [Ping timeout: 252 seconds]
mingus1 is now known as mingus
mjoerg has quit [Remote host closed the connection]
lisp123 has quit [Remote host closed the connection]
aartaka has quit [Ping timeout: 255 seconds]
julio has joined #commonlisp
aartaka has joined #commonlisp
julio is now known as ClickHacker
Cymew has quit [Quit: Konversation terminated!]
hashfunc has joined #commonlisp
Cymew has joined #commonlisp
hashfunc has quit [Ping timeout: 260 seconds]
ClickHacker has quit [Ping timeout: 260 seconds]
lisp123 has joined #commonlisp
Cymew has quit [Ping timeout: 248 seconds]
lisp123 has quit [Ping timeout: 272 seconds]
aartaka has quit [Ping timeout: 260 seconds]
ClickHacker has joined #commonlisp
aartaka has joined #commonlisp
nij- has joined #commonlisp
<nij-> With shell command `cat file > sha1sum` I can get the sha1 of the content of the file. How to do that in CL?
<nij-> ; in a native way.. if none I can call shell from CL..
<jackdaniel> did you mean maybe `cat file | sha1sum` ?
<jackdaniel> I think that ironclad has sha functions
ClickHacker has quit [Ping timeout: 272 seconds]
aartaka has quit [Ping timeout: 260 seconds]
<nij-> Oh yes, a stupid typo.
aartaka has joined #commonlisp
<nij-> ironclad seems a bit involving. I found sha1, which seems to do what I want. However,
<nij-> While `echo abc | sha1sum` (=> 03cfd743661f07975fa2f1220c5194cbaff48451 -),
<nij-> (sha1:sha1-digest "abc") ;; => (169 153 62 54 71 6 129 106 186 62 37 113 120 80 194 108 156 208 216 157)
<nij-> Is there a universal translating scheme between these two types of return?
<jackdaniel> if I were forced to take a guess, then I'd say that it is possible
<Shinmera> crypto-shortcuts has conversions
<_death> try echo -n abc | sha1sum
<hayley> Yes, mind the newline.
<scymtym> the ironclad equivalent is (ironclad:byte-array-to-hex-string (ironclad:digest-sequence :sha1 (babel:string-to-octets (format nil "abc~%")))) => "03cfd743661f07975fa2f1220c5194cbaff48451"
<Shinmera> mind the gap please
cage has joined #commonlisp
<nij-> scymtym Wow, thank you :D
<scymtym> nij-: sure
Guest96100 has joined #commonlisp
<nij-> Your example immediately teaches me how to use ironclad, by comparing to a tool that I'm more familiar with :)
aartaka has quit [Ping timeout: 255 seconds]
<pjb> nij-: the right shell command is sha1sum < file
aartaka has joined #commonlisp
<pjb> (typep 42 (type-of most-positive-fixnum)) ;-)
VincentVega has joined #commonlisp
hashfunc has joined #commonlisp
aartaka has quit [Read error: Connection reset by peer]
aartaka has joined #commonlisp
hashfunc has quit [Ping timeout: 260 seconds]
<phoe> (typep 2 (type-of 1))
NotThatRPG has joined #commonlisp
Fredokun has quit [Ping timeout: 252 seconds]
Fredokun has joined #commonlisp
aartaka has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
<nij-> Offtopic sorry .. pjb Why is `sha1sum < file` better than `cat file | sha1sum`?
<splittist> nij-: presumably the first avoids starting a new cat process - the shell is doing the redirection itself
<splittist> If I apt install sbcl, am I just opening myself up for a world of hurt?
Guest96100 has quit [Ping timeout: 260 seconds]
<phoe> not really
<nij-> I'm not sure about apt-install, but I remembered some pain when I relied on pacman for sbcl back then.
<phoe> if you apt install cl-foo for any value of foo then the world of hurt opens
<phoe> but the implementation itself, you can install it from apt
<splittist> phoe: thanks
<nij-> I remember pacman also include some libs, which stumpwm would look at and complain.
* splittist welcomes sbcl 2.0.1
<phoe> ah yes, the beauty of debian stable
<phoe> ...wait, no, stable has 2.1.1
ttree has joined #commonlisp
karlosz has joined #commonlisp
<splittist> "Hacks and glory await!" nevertheless
kenran has joined #commonlisp
kenran has quit [Remote host closed the connection]
Fare has joined #commonlisp
<pjb> nij-: indeed, cat | sha1sum need to for two processes instead of one, and to create a pipe. In the shell "repl" it doesn't matter much, but in shell scripts this could slow down the script. Furthermore, cat doesn't always copy the file byte-for-byte. It has options to do some formatting.
<pjb> somebody could have: alias cat='/bin/cat -s -v' so that when it's used in the terminal to dump a file, adjacent empty lines be squeezed, and control characters printed as ^X. sha1-summing that wouldn't be meaningful.
Spawns is now known as Spawns_Carpeting
<phoe> geez, (setf *read-default-float-format* 'rational) is handy
seletz_ has joined #commonlisp
hashfunc has joined #commonlisp
seletz has quit [Ping timeout: 260 seconds]
VincentVega has left #commonlisp [ERC 5.4 (IRC client for GNU Emacs 28.2)]
Lycurgus has joined #commonlisp
hashfunc has quit [Ping timeout: 252 seconds]
<pjb> phoe: but only if the implementation allows it.
<pjb> One of the atomic type specifiers short-float, single-float, double-float, or long-float, or else some other type specifier defined by the implementation to be acceptable.
<phoe> yes
<phoe> my implementation allows it and it's damn convenient
<pjb> :-)
Lycurgus has quit [Quit: Exeunt: personae.ai-integration.biz]
aartaka has quit [Ping timeout: 246 seconds]
aartaka has joined #commonlisp
Fredokun has quit [Ping timeout: 252 seconds]
alfonsox has quit [Read error: Connection reset by peer]
masinter has quit [Remote host closed the connection]
Sauvin has quit [Ping timeout: 268 seconds]
Fredokun has joined #commonlisp
Sauvin has joined #commonlisp
<splittist> phoe: convenient for... ?
aartaka has quit [Ping timeout: 272 seconds]
aartaka has joined #commonlisp
<pjb> splittist: using ratios instead of floating point to get exact computations.
<pjb> see for example: https://termbin.com/e9zq
<pjb> now the funny thing is that ratio gives a double-float result (in ccl), instead of ratio. On the other hand, rational gives a ratio result (in ccl)…
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
ClickHacker has joined #commonlisp
hashfunc has joined #commonlisp
dcb has joined #commonlisp
rgherdt has quit [Read error: Connection reset by peer]
rgherdt has joined #commonlisp
ClickHacker has quit [Ping timeout: 252 seconds]
hashfunc has quit [Ping timeout: 255 seconds]
seletz_ has quit [Ping timeout: 246 seconds]
tyson2 has quit [Remote host closed the connection]
Fredokun has quit [Ping timeout: 248 seconds]
seletz has joined #commonlisp
igemnace has quit [Remote host closed the connection]
waleee has joined #commonlisp
seletz has quit [Ping timeout: 268 seconds]
krjst has quit [Quit: bye]
krjst has joined #commonlisp
hashfunc has joined #commonlisp
hashfunc has quit [Ping timeout: 255 seconds]
seletz has joined #commonlisp
morganw has joined #commonlisp
tyson2 has joined #commonlisp
ClickHacker has joined #commonlisp
igemnace has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
seletz has quit [Ping timeout: 268 seconds]
seletz has joined #commonlisp
tyson2 has joined #commonlisp
seletz has quit [Ping timeout: 252 seconds]
ClickHacker has quit [Ping timeout: 252 seconds]
aartaka has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
tyson2 has quit [Ping timeout: 252 seconds]
tyson2 has joined #commonlisp
hashfunc has joined #commonlisp
jeosol has quit [Quit: Client closed]
hashfunc has quit [Ping timeout: 260 seconds]
deadmarshal_ has quit [Quit: IRCNow and Forever!]
dirtcastle has quit [Quit: IRCNow and Forever!]
deadmarshal_ has joined #commonlisp
dirtcastle has joined #commonlisp
Fare has quit [Quit: Leaving]
seletz has joined #commonlisp
<phoe> splittist: writing decimal numbers, think prices and such
<phoe> it's more convenient for me to write 199.99 than fixed-point 19999 or direct ratio 19999/100
<phoe> this way I avoid using floats for fixed-point numbers which is a known recipe for disaster
tyson2 has quit [Remote host closed the connection]
pandlefd has joined #commonlisp
seletz has quit [Ping timeout: 260 seconds]
aartaka has quit [Ping timeout: 268 seconds]
dirtcastle has quit [Quit: IRCNow and Forever!]
deadmarshal_ has quit [Quit: IRCNow and Forever!]
<pjb> phoe: now, there's a problem, because is it $199.99 or 199.99€ ? Hence my reader macro: #m199.99 (using the *default-currency* or with explicit currencies: '(#840m199.99 #978m199.99) --> (199.99 USD 199.99 EUR)
Fredokun has joined #commonlisp
<phoe> pjb: I only have one currency so that's not a problem
<phoe> but still, (pln 199.99) would also work for a one-arg constructor that creates an instance of PLN currency
Fredokun has quit [Read error: Connection reset by peer]
pandlefd has quit [Quit: going away to do something? why do i need a reason?]
ClickHacker has joined #commonlisp
Posterdati has quit [Read error: Connection reset by peer]
<pjb> phoe: Sure #985m199.99 --> 199.99 PLN
<pjb> (setf com.informatimago.common-lisp.invoice.invoice::*default-currency* (com.informatimago.common-lisp.cesarum.iso4217:find-currency "PLN")) --> ("PLN" 985 2 "Zloty") ; then:
<pjb> #m199.99 --> 199.99 PLN
deadmarshal_ has joined #commonlisp
dirtcastle has joined #commonlisp
igemnace has quit [Remote host closed the connection]
<jackdaniel> is (mod (lognot x) (integer-length x)) the right way to negate insigned integer bitwise?
<jackdaniel> unsigned*
Posterdati has joined #commonlisp
<jackdaniel> expt 2 intlen
augendredoubt has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 272 seconds]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life_ is now known as Lord_of_Life
ClickHacker has quit [Ping timeout: 252 seconds]
rgherdt has quit [Remote host closed the connection]
mingus has quit [Ping timeout: 264 seconds]
cage has quit [Quit: rcirc on GNU Emacs 28.2]
MajorBiscuit has quit [Quit: WeeChat 3.6]
tyson2 has joined #commonlisp
<kakuhen> sounds right to me... `(ldb (byte (integer-length x) 0) (lognot x))` is what I would've guessed
<jackdaniel> makes sense, thanks
<jackdaniel> ldb indeed seems better
seletz has joined #commonlisp
seletz has quit [Ping timeout: 246 seconds]
zyni-moe has joined #commonlisp
seletz has joined #commonlisp
ldb has joined #commonlisp
<White_Flame> jackdaniel: I think that the numeric width should be irrelevant to the current value's bit width
<kakuhen> well, the more i think about it, i dont think integer-length is a very good idea, because you may want to negate e.g. #b010 and expect #b101 instead of #b01 (which is what my suggestion would give)
<White_Flame> you 2s complement negate it within a specific word length
<ldb> you can just take the mod
<ldb> or logand
<kakuhen> yeah, so something like (defun unsigned-negate (byte length) (logand (1- (ash 1 length)) (lognot byte)))
zyni-moe has quit [Quit: died]
attila_lendvai has joined #commonlisp
seletz has quit [Ping timeout: 260 seconds]
ldb has quit [Client Quit]
ldb has joined #commonlisp
<pjb> jackdaniel: the negate operator in CL is - (let ((unsigned-integer 42)) (- unsigned-integer)) #| --> -42 |# what do you have against it?
<phoe> bitwise negation of an unsigned byte of a known length results in an unsigned byte
<pjb> jackdaniel: or (lognot 42) #| --> -43 |#
<phoe> whereas #'- results in a possibly signed-byte
<phoe> I assume that's the problem here
<pjb> phoe: my point, the length needs to be known before hand. And therefore (logand #xffffffff (lognot x)) eg if it's 32.
<pjb> 42 is …000101010 in binary; it's bitwise negation should be …111010101 ; computing …000101010 --> …000010101 seems meaningless to me.
<pjb> Now, you may consider 1-complement, or 2-complement, with a predetermined word length. (logand #xff (lognot 42)) #| --> 213 |# may seem strange, but bitwise is clear: 00101010 --> 11010101
ClickHacker has joined #commonlisp
* ldb just completed adding lisp symbol index to CLtL2, would not consider add the glossary
pve has quit [Quit: leaving]
nij- has joined #commonlisp
<nij-> Any CL system that helps compute "1+8*9" (=> 73) and so forth?
<White_Flame> you mean a library to call? there is an infix-math system
<ldb> april helps compute "1+8×9" → 73
<nij-> But I don't like typing ×..
<nij-> White_Flame Yeah.
<nij-> Input needs to be a string, and output is the calculated answer..
<morganw> I'm pretty sure that the Winston and Horn book has a section which implements an infix form converter.
<White_Flame> most lisp infix tools deal with (1 + 2 * 3) sorts of forms, not strings, so breaking apart the string will be a separate issue.
<ldb> as these days there are plenty of parser generator I just recommand to try build one with them, like https://github.com/eugeneia/maxpc
<ixelp> GitHub - eugeneia/maxpc: Max’s Parser Combinators: a simple and pragmatic library for writing parsers and lexers based o [...]
ClickHacker has quit [Read error: Connection reset by peer]
shka has quit [Ping timeout: 260 seconds]
ClickHacker has joined #commonlisp
dec0d3r has joined #commonlisp
morganw has quit [Remote host closed the connection]
karlosz has quit [Quit: karlosz]
karlosz has joined #commonlisp