mrcom has quit [Remote host closed the connection]
mrcom has joined #commonlisp
mrcom has quit [Remote host closed the connection]
mrcom has joined #commonlisp
ttree has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 248 seconds]
Lord_of_Life has joined #commonlisp
causal has joined #commonlisp
Oladon has joined #commonlisp
dre has joined #commonlisp
Guest74 has joined #commonlisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
waleee has quit [Ping timeout: 258 seconds]
mon_aaraj has quit [Ping timeout: 248 seconds]
mon_aaraj has joined #commonlisp
xaltsc has quit [Quit: WeeChat 3.5]
simendsj` has joined #commonlisp
simendsjo has quit [Ping timeout: 272 seconds]
orestarod has quit [Ping timeout: 248 seconds]
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
aartaka has joined #commonlisp
Oladon has quit [Quit: Leaving.]
dre has quit [Ping timeout: 244 seconds]
dBc has joined #commonlisp
even4void has quit [Ping timeout: 248 seconds]
ldb has joined #commonlisp
even4void has joined #commonlisp
yewscion has joined #commonlisp
<beach>
Good morning everyone!
Bike has quit [Quit: Lost terminal]
<ldb>
morning
akoana has quit [Ping timeout: 256 seconds]
akoana has joined #commonlisp
akoana has quit [Quit: leaving]
rotateq has joined #commonlisp
<mfiano>
Morning
<mfiano>
My first Common Lisp (command-line) application (only wrote libraries before) is nearing completion, but I have been taking time to learn LaTeX (it's been about 20 years since I touched it, and have forgotten nearly everything) so I can write good offline documentation for my program.
yewscion has quit [Ping timeout: 272 seconds]
<aeth>
I guess it depends on if you still have your old files from 20 years ago
<aeth>
ime, LaTeX is all about starting from a working document
<aeth>
probably because the "makefile"-like thing is in the header of the file instead of in a separate file and that's always the part that's hardest for any language
<mfiano>
The engine going forward is going to be lualatex it seems.
<mfiano>
Such a shame. But not like I'm going to embed Lua
leeb has joined #commonlisp
<ldb>
mfiano: do you know Donald Knuth's CWEB?
<mfiano>
I'm not a fan of literate programming.
<ldb>
I do like the concept of program refinement, that is, starting with a skeleton and adding deatails
tyson2 has quit [Remote host closed the connection]
ldb has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
leeb has quit [Ping timeout: 244 seconds]
leeb has joined #commonlisp
shka has joined #commonlisp
ttree has quit [Ping timeout: 240 seconds]
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
<Josh_2>
Good mornin'
yw61 has joined #commonlisp
<Josh_2>
I really should fix the fact that auth-source-search fails to get my irc password :sob:
shka has quit [Ping timeout: 240 seconds]
lisp123 has joined #commonlisp
<lisp123>
capitalise constants?
<lisp123>
or just use +..+
<Josh_2>
Constants are wrapped in +...+
<lisp123>
Cool ok
azimut has quit [Ping timeout: 240 seconds]
Posterdati has quit [Read error: Connection reset by peer]
<pjb>
mfiano: I have a com.informatimago.common-lisp.cesarum.utility:nsubseq
Josh_2 has quit [Quit: ERC (IRC client for Emacs 27.1)]
<rotateq>
lisp123: And capitalism constants would be wrapped into $foo$.
<lisp123>
rotateq: Haha - that's a good one
<pjb>
mfiano: also, you may consider ldiff, which lets you represent lists as difference lists. It's a technique used eg. in prolog to represent circular lists. But it can serve here I think.
<contrapunctus>
a proper list, acceptable to `listp`
<beach>
Oh, so TYPEP won't do?
<beach>
If not, I would go for Alfr's solution.
rainthree3 has joined #commonlisp
<contrapunctus>
typep worked, thanks :)
<beach>
Great1
<beach>
!
bilegeek has quit [Quit: Leaving]
rainthree has quit [Ping timeout: 248 seconds]
leeb has quit [Quit: WeeChat 3.4.1]
hayley has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
lisp123 has joined #commonlisp
OlCe has quit [Read error: Connection reset by peer]
mon_aaraj has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
lisp123 has joined #commonlisp
random-nick has joined #commonlisp
yw61 has quit [Quit: Client closed]
rainthree3 has quit [Ping timeout: 256 seconds]
OlCe has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
<pjb>
contrapunctus: if you want to find instances of standard-class then use (typep x 'standard-class)
<pjb>
contrapunctus: if you want to find instances of my-class then use (typep x 'my-class)
<pjb>
contrapunctus: note that instances of subclasses are also instances of the class!!!
lisp123 has joined #commonlisp
McParen has joined #commonlisp
karlosz has joined #commonlisp
ttree has quit [Ping timeout: 256 seconds]
Dynom has joined #commonlisp
treflip has quit [Quit: Quit]
cosimone has joined #commonlisp
cage has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
karlosz has quit [Ping timeout: 244 seconds]
mon_aaraj has joined #commonlisp
karlosz has joined #commonlisp
kpoeck has joined #commonlisp
karlosz has quit [Quit: karlosz]
orestarod has joined #commonlisp
lisp123 has left #commonlisp [Leaving...]
tyson2 has joined #commonlisp
lisp123 has joined #commonlisp
McParen has left #commonlisp [#commonlisp]
lisp123 has quit [Remote host closed the connection]
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
lisp123 has joined #commonlisp
kaskal- has joined #commonlisp
kaskal has quit [Ping timeout: 256 seconds]
lisp123 has quit [Ping timeout: 255 seconds]
mon_aaraj has quit [Ping timeout: 244 seconds]
mon_aaraj has joined #commonlisp
lisp123 has joined #commonlisp
<utis_>
is lquery the tool to use for parsing xml that may not be well-formed? the documentation is pretty terse; how is one to isolate based on attributes? say i have "<foo bar="baz" . . ." i've tried ($ *doc* "foo" (attr "bar" "baz") (text)) but that still selects all the foos.
lisp123 has quit [Quit: Leaving...]
rainthree has joined #commonlisp
rainthree3 has joined #commonlisp
kpoeck has quit [Quit: Client closed]
rainthree has quit [Ping timeout: 255 seconds]
rodicm has quit [Ping timeout: 246 seconds]
rainthree3 has quit [Ping timeout: 255 seconds]
Brucio-61 has quit [Read error: Connection reset by peer]
scymtym has quit [Read error: Connection reset by peer]
scymtym has joined #commonlisp
Brucio-61 has joined #commonlisp
rodicm has joined #commonlisp
xaltsc has joined #commonlisp
kpoeck has joined #commonlisp
waleee has joined #commonlisp
Dynom has quit [Quit: WeeChat 3.5]
waleee has quit [Ping timeout: 244 seconds]
igemnace has quit [Remote host closed the connection]
tyson2 has quit [Remote host closed the connection]
rogersm has quit [Quit: Leaving...]
waleee has joined #commonlisp
rainthree has joined #commonlisp
kpoeck has quit [Ping timeout: 252 seconds]
kpoeck has joined #commonlisp
rainthree3 has joined #commonlisp
rainthree has quit [Ping timeout: 260 seconds]
cosimone has quit [Remote host closed the connection]
n1to has joined #commonlisp
rodicm has quit [Ping timeout: 248 seconds]
yagamisato has quit [K-Lined]
azimut has joined #commonlisp
aartaka has quit [Ping timeout: 255 seconds]
aartaka has joined #commonlisp
tyson2 has joined #commonlisp
<Guest74>
is there a way to return only n decimal places from math functions?
<beach>
Common Lisp does not represent floats as decimals.
<rotateq>
Guest74: You mean for their printed representation?
<beach>
The only way you can obtain decimal digits is by printing the float in base 10.
<beach>
Guest74: FORMAT contains requests for such things.
waleee has quit [Ping timeout: 250 seconds]
<Guest74>
rotateq: no, formats got that covered.
<rotateq>
Okay.
<Shinmera>
utis_: ($ *doc* "foo[bar=baz]"). It's just CSS selectors, as the documentation says.
<beach>
Guest74: Does that make sense to you?
<Guest74>
I guess I can multiply by 100 round and then divide again.
<beach>
But that might lose precision.
<Guest74>
yes, that's kind of the point.
<beach>
No, I mean, you won't get the value 2.34 if you divide 234 by 100.
<beach>
Not all decimal numbers have exact representations as binary floating-point numbers.
rodicm has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
<utis_>
Shinmera: ah! i suppose that's more salient when one knows what a css selector is. thanks!
<beach>
Guest74: So I guess the answer to my last question was "no", and maybe still is?
<White_Flame>
specifically, you'll want to keep the integer number of hundredths (eg, don't divide again after rounding), or a string representation.
<beach>
That, or just remember that your numbers are 100x what they represent.
<White_Flame>
right, that's the integer number of hundredths
<beach>
Like for applications using money.
<beach>
Ah, OK, I see what you mean now.
<White_Flame>
though even if you divide by 100, you'll still need to use FORMAT to truncate any FP rounding errors, so that number isn't "self-contained" in terms of its intended representation
<White_Flame>
s/trunctate/round/
<White_Flame>
though still possible to use as a plain fp value of approximately the intended value
<beach>
Sure, if that is acceptable.
<White_Flame>
I think some languages have decimal based floats, but not CL (natively)
<beach>
You just have to be careful so that you don't assume things like (= (/ 234 100) 2.34) to be true.
aartaka has joined #commonlisp
<beach>
For money, I think floats should probably be avoided entirely.
<beach>
The 100 made me think this might be the intended application.
<White_Flame>
yep, and as you say, most financial applications keep track of pennies, or even 100ths of pennies
mon_aaraj has quit [Ping timeout: 256 seconds]
<White_Flame>
(2 or 4 decimal digit fixed point)
<beach>
I didn't know about 4. Thanks for that information.
<Guest74>
Just trying to achieve the same mathematical results as some libraries.
<White_Flame>
a lot of stock & currency stuff is standardized to 4-digit "pips"
<beach>
Guest74: Wow, what libraries use decimal floats?
<White_Flame>
*currency exchange
<beach>
Guest74: What language would such a library be written in?
<Guest74>
graphics stuff.
<beach>
White_Flame: I see. Interesting.
<beach>
Guest74: Decimal floats? Truly? Are you sure?
<Guest74>
some stuff people like was based on hardware or specific software, or even bugs in libraries.
mon_aaraj has joined #commonlisp
<beach>
Using decimal floats for graphics would be very slow.
<beach>
... in most languages, I mean.
<beach>
Maybe not COBOL or PL/I.
<White_Flame>
Guest74: what other systems do you mean specifically?
dBc has joined #commonlisp
pfd has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
rodicm has quit [Remote host closed the connection]
rodicm has joined #commonlisp
<White_Flame>
(iirc, .swf had a resolution of 1/20th of a pixel, for some strange reason)
<pl>
beach: even in those. There's a reason why some hw has IEEE decimal128 in FPU
<beach>
Indeed.
<Guest74>
White_Flame: well right now it's just about typography and type scales.
<rotateq>
I see often going from symbolic to numeric too fast as maybe loosing important information for later.
<beach>
Guest74: So you don't have any such library in mind? Then why are you thinking of decimal floats?
<Guest74>
but some formulas for colour, especially old ones, are specified to have a certain amount of precision.
<Guest74>
beach: why do you keep saying decimal floats?
<beach>
Exact decimal values? That sounds very surprising.
<beach>
Guest74: Because that's what you have been asking for from the start.
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
<beach>
Guest74: You wanted mathematical function to return results with a number of DECIMAL places.
<Guest74>
I wasn't aware that's what I asked at all.
<beach>
"is there a way to return only n decimal places from math functions?"
<beach>
And then you suggested a "solution" by multiplying by 100, rounding, and then dividing by 100.
<beach>
So, if decimal floats is not what you want, what is it?
rodicm has quit [Remote host closed the connection]
<White_Flame>
if you're doing typography, is the floating point error going to be meaningful enough to really worry about it?
rodicm has joined #commonlisp
<Guest74>
it's more about UX
<beach>
Can you elaborate on that?
<Guest74>
experiencing what they're used to in other programs.
<White_Flame>
so this is just about the string represention on screen then
<beach>
OK, good luck then.
<beach>
White_Flame: If it were, FORMAT would be the thing, but that was eliminated early on.
<Guest74>
White_Flame: The string representation wont be the same if the calculation isn't the same.
<White_Flame>
I don't get it
<White_Flame>
a string representation limited to 2 decimal digits of course will not be exactly equivalent to some internally computed float value... is that a problem?
rodicm has quit [Remote host closed the connection]
rodicm has joined #commonlisp
<White_Flame>
I get the impression that the actual core question hasn't been asked yet
rodicm has quit [Remote host closed the connection]
rodicm has joined #commonlisp
<Guest74>
my visual formatted string does not match the visual results of other tools. Like I said, it's about UX, at least in this case. Dealing with colour difference formulas the errors were getting quite large using.
ec has joined #commonlisp
<White_Flame>
"results" as in the strings displayed by other tools?
<White_Flame>
like you print 23.87999994, and the ohter prints 23.88?
<Guest74>
Now, as to why some standards body decided that all calucations were to 4 decimal places, or why people design their formulas a certain way I don't know, I'm just trying to match the results.
<Guest74>
oh god, 2.34 2.33
bilegeek has joined #commonlisp
Guest74 has quit [Quit: Connection closed]
rodicm has quit [Remote host closed the connection]
rodicm has joined #commonlisp
<White_Flame>
ok, if the standards mandate the type of arithmetic to be computed to 4 decimal digits, then you either need decimal floats or x1000 fixed-point values, with the rounding they mandate
rodicm has quit [Read error: Connection reset by peer]
rodicm has joined #commonlisp
<White_Flame>
I seriously doubt you'll get any visual differences in the rendering, but you'll be off by sub-1000ths if you just use floats
ldb has joined #commonlisp
pfd has quit [Quit: Client closed]
<Nilby>
Guest74: the postscript i worked on actually used fixed precision in 32 bits for most things
rodicm has quit [Ping timeout: 258 seconds]
rodicm_ has joined #commonlisp
dBc has quit [Quit: leaving]
rodicm_ has quit [Remote host closed the connection]
rodicm_ has joined #commonlisp
<White_Flame>
Nilby: was that mandated by the spec?
<Nilby>
White_Flame: yes, some fixed point was mandated, but also when you compare renderers it becomes obvious that's whats done. old printers didn't necessarily have floating point hardware
rodicm_ has quit [Ping timeout: 248 seconds]
rodicm has joined #commonlisp
rodicm has quit [Remote host closed the connection]
rodicm has joined #commonlisp
rodicm_ has joined #commonlisp
rodicm has quit [Ping timeout: 255 seconds]
rodicm_ has quit [Ping timeout: 272 seconds]
rodicm has joined #commonlisp
rodicm has quit [Remote host closed the connection]
rodicm has joined #commonlisp
rodicm_ has joined #commonlisp
rodicm has quit [Ping timeout: 258 seconds]
notzmv has quit [Ping timeout: 248 seconds]
causal has quit [Quit: WeeChat 3.5]
<ldb>
I thought (defvar *foo*) is the same as (defvar *foo* nil)
<ldb>
turns out I'm wrong, even emacs lisp would report unbound variable error for (defvar *foo*)
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
<White_Flame>
defparameter doesn't default to NIL either, but requires you to list the value.
rodicm_ has quit [Remote host closed the connection]
rodicm has joined #commonlisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
ldb has quit [Ping timeout: 246 seconds]
rodicm has quit [Ping timeout: 246 seconds]
prokhor_ has joined #commonlisp
rodicm has joined #commonlisp
kpoeck has quit [Quit: Client closed]
rodicm has quit [Read error: Connection reset by peer]
rodicm has joined #commonlisp
rodicm_ has joined #commonlisp
rodicm has quit [Ping timeout: 244 seconds]
treflip has joined #commonlisp
waleee has joined #commonlisp
rodicm has joined #commonlisp
morganw has joined #commonlisp
rodicm_ has quit [Ping timeout: 244 seconds]
rodicm_ has joined #commonlisp
rodicm__ has joined #commonlisp
rodicm has quit [Ping timeout: 248 seconds]
rodicm_ has quit [Ping timeout: 255 seconds]
<pjb>
Guest8247: round et al. take a second argument! (* (round pi 0.001) 0.001) #| --> 3.1420002 |# so you don't need to do the divide yourself.
karlosz has joined #commonlisp
ttree has joined #commonlisp
rodicm__ has quit [Ping timeout: 256 seconds]
rodicm has joined #commonlisp
rodicm_ has joined #commonlisp
rodicm has quit [Ping timeout: 256 seconds]
karlosz has quit [Ping timeout: 256 seconds]
rodicm_ has quit [Remote host closed the connection]
rodicm has joined #commonlisp
ldb has joined #commonlisp
epolanski has joined #commonlisp
rodicm has quit [Ping timeout: 240 seconds]
ldb has quit [Ping timeout: 248 seconds]
rodicm has joined #commonlisp
rodicm has quit [Ping timeout: 248 seconds]
rodicm has joined #commonlisp
rodicm has quit [Ping timeout: 246 seconds]
rodicm_ has joined #commonlisp
rodicm has joined #commonlisp
rodicm has quit [Read error: Connection reset by peer]
rodicm has joined #commonlisp
rodicm_ has quit [Ping timeout: 244 seconds]
rodicm has quit [Ping timeout: 246 seconds]
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
ldb has joined #commonlisp
morganw has quit [Read error: Connection reset by peer]
subpsunym has quit [Quit: leaving]
karlosz has joined #commonlisp
morganw has joined #commonlisp
Guest74 has joined #commonlisp
karlosz has quit [Ping timeout: 240 seconds]
treflip has quit [Quit: bye!]
pranavats has left #commonlisp [Error from remote client]