notzmv has quit [Read error: Connection reset by peer]
decweb has quit [Quit: Konversation terminated!]
decweb has joined #commonlisp
varjag has joined #commonlisp
Odin- has joined #commonlisp
decweb has quit [Quit: Konversation terminated!]
varjag has quit [Ping timeout: 260 seconds]
<stylewarning>
Is there a way to have a global struct instance that's EQ-const and doesn't screw up with load forms, file compiler, whatever?
<aeth>
make-load-form-saving-slots does work on structure-objects as well as standard-objects.
<aeth>
I'm not sure if this satisfies all of your requirements, though
<stylewarning>
i am using it to try to pull a cached value but to no avail, probably i'm doing something wrong
<aeth>
Usually, when I have something like this, I choose to give up type safety and encode things as integers or as arrays of integers, and then decode those when required.
<aeth>
because (= 42 42) where #b101010 i.e. 42 has some sort of encoded meaning seems easier than trying to make structs work properly here
<aeth>
and it's just calling = or mapping #'=
troojg has quit [Ping timeout: 276 seconds]
<aeth>
Playing around with load forms should work, but it's tricky
<stylewarning>
esp. if you want to be portable; CCL seems to require load forms more often than SBCL
X-Scale has quit [Ping timeout: 260 seconds]
peterhil has joined #commonlisp
Odin- has quit [Read error: Connection reset by peer]
Odin- has joined #commonlisp
jonatack has joined #commonlisp
peterhil has quit [Ping timeout: 248 seconds]
<stylewarning>
i just pushed the objects onto a symbol plist and used that as the eq cache like a 700 IQ genius
<stylewarning>
smlckz: cool; most of my feedback is stylistic. looks good overall
<|3b|>
~@d will print an integer with a + sign
X-Scale has joined #commonlisp
<|3b|>
actually, format-complex could just be (format nil "~[~:;~:*~d~]~[~:;~:*~@di~]" (realpart c) (imagpart c)) if you don't care about 0
<|3b|>
"~[~:;~:*~d~]~[~1:*~[0~]~:;~:*~@di~]" to print 0 properly
<wbooze>
morning
* |3b|
would probably also write norm as (+ (expt (realpart c) 2) (expt (imagpart c) 2)), and use LOOP instead of DO, but looks generally reasonable aside from some minor efficiency things
X-Scale has quit [Ping timeout: 260 seconds]
istewart has quit [Quit: Konversation terminated!]
King_julian has joined #commonlisp
cercopith has joined #commonlisp
Catie` has joined #commonlisp
toadlicker_ has joined #commonlisp
toadlicker has quit [Read error: Connection reset by peer]
loke has quit [Ping timeout: 244 seconds]
jackdaniel has quit [Ping timeout: 244 seconds]
jackdaniel has joined #commonlisp
loke has joined #commonlisp
Catie has quit [Ping timeout: 265 seconds]
Gleefre has joined #commonlisp
vjalmr has joined #commonlisp
edgar-rft` has joined #commonlisp
pve has joined #commonlisp
edgar-rft has quit [Ping timeout: 252 seconds]
mgl has joined #commonlisp
ingeniot has joined #commonlisp
admich1 has quit [Read error: Connection reset by peer]
admich1 has joined #commonlisp
wbooze has quit [Ping timeout: 252 seconds]
dsgdsg has joined #commonlisp
chomwitt has joined #commonlisp
wbooze has joined #commonlisp
bpanthi977 has joined #commonlisp
ingeniot has quit [Ping timeout: 244 seconds]
bpanthi977 has quit [Ping timeout: 260 seconds]
attila_lendvai has joined #commonlisp
fosskers has quit [Remote host closed the connection]
peterhil has joined #commonlisp
lucerne has quit [Ping timeout: 260 seconds]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
lucerne has joined #commonlisp
leeb has joined #commonlisp
leeb_ has quit [Ping timeout: 265 seconds]
bpanthi977 has joined #commonlisp
bpanthi977 has quit [Ping timeout: 268 seconds]
bpanthi977 has joined #commonlisp
bpanthi977 has quit [Ping timeout: 248 seconds]
<smlckz>
|3b|: thanks! Umm, how can I have the pure positive imaginary numbers not have sign printed, so 3i instead of +3i ?
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
<|3b|>
hmm, that one might be worth just using an IF for :p though i think you could do it by backing up by 2 and using another ~[ inside the one for imagpart
<|3b|>
but i think "~[~:;~:*~d~]~[~:;~2:*~[~d~:;~@d~]i~]"
<|3b|>
and the previous version to print 0 correctly should have also used ~2:* not ~1:*
<jackdaniel>
and who said that lisp is easy to read? ,)
<|3b|>
alternately, just write a print-object or pprint-dispatch and print it with simpler functions, then it is just ~a or whatever :)
<jackdaniel>
FORMAT combines readibility of APL with an intuitive syntax of perl
<smlckz>
Is there any other esoteric sub languages in common lisp?
<|3b|>
LOOP and FORMAT are the main ones, more so the latter
<|3b|>
possibly could include types
dsgdsg has quit [Remote host closed the connection]
dsgdsg has joined #commonlisp
<smlckz>
loop can not be considered esoteric, can it be? it's really.. comprehensive, let's say
<|3b|>
esoteric relative to lisp at least, though other perspectives might reverse the sign :)
<|3b|>
and LOOP is missing a lot of things, most notably some way to extend it portably
X-Scale has joined #commonlisp
<smlckz>
something like iterator 'protocol', is it?
<|3b|>
not just that, but being able to add clauses, like to maximize by a function of the value
<smlckz>
Oh, the last format doesn't print anything for 0 0
<|3b|>
right, i mentioned that previously
<|3b|>
"~[~:;~:*~d~]~[~2:*~[0~]~:;~2:*~[~d~:;~@d~]i~]" i think is the correct version to do both
* |3b|
does think it would be reasonable to just use IF to handle the 0 real case separately though
triffid has quit [Ping timeout: 244 seconds]
<smlckz>
Yes, it's reasonable; but we've reached this far, why not let format take care of it ;)
<smlckz>
Oh, by the way, format control string sub language isn't Turing complete, is it?
<|3b|>
might depends on what external support you allow it, but probably not?
<smlckz>
I remember a few years ago some IOCCC submission proved C printf to be Turing complete..
* |3b|
wouldn't be surprised if (loop (setf x (format nil x))) could run some cellular automata for appropriate X
<|3b|>
or (loop (setf x (split-sequence (format nil f x))))
<|3b|>
but actually saving enough state within a single call to format to do anything would be harder
<smlckz>
Ah, can you explain how the conditional distinguishes between positive and negative integer there?
triffid has joined #commonlisp
<|3b|>
~@d distinguishes between positive/negative
<|3b|>
~[ ~:; ~] distinguieshes between zero and non-zero
<|3b|>
and ~2:* goes back by 2 to look at the real part again
<|3b|>
so first clause is "if real is non-zero, print it"
<|3b|>
then 2nd is "if imag is zero, go back to real, if it is zero, print a 0" and "otherwise, go back to real, if zero print imag with ~d, otherwise print with ~@d"
<|3b|>
~[~:;~] consumes an argument, so ~:* goes back one if it needs to print it for the real part
<smlckz>
hmmm
<|3b|>
or possibly more accurately, it doesn't distinguish positive/negative, it just always prints a sign if real is non-zero, and uses the default of printing only - for real or for imag when real is 0
chiselfuse has quit [Remote host closed the connection]
<|3b|>
for minor performance things, check LOGAND before PRIMEP in CHECK, and the loop in PRIMEP should probably save (isqrt n) and compare that to d instead of calculating d² every iteration
<jackdaniel>
generally it is about how DO is not an interation operator but rather recursion one
<jackdaniel>
s/interation/iteration/
<|3b|>
jackdaniel: s/remainder/reminder/ in that post?
<jackdaniel>
yes, thanks
<smlckz>
Also, please include article title in HTML <title>; noticed this when bookmarking
King_julian has quit [Read error: Connection reset by peer]
dajole has quit [Quit: Connection closed for inactivity]
<smlckz>
I'll keep DO, it's not as bad as SETQ to SETF, I think?
King_julian has joined #commonlisp
<wbooze>
yeah
<wbooze>
do is fine
<wbooze>
as long as you can deal with it
<|3b|>
yeah, more personal style than general style.. others would tell you to get rid of the LOOP instead :)
<wbooze>
more lispy than loop for sure
<wbooze>
format is not lispy either
<wbooze>
it's more fortran right ?
<jackdaniel>
these statements are very arguable
<jackdaniel>
especially because lisp boosts dsl capabilities
* |3b|
would argue "implement a DSL to express what you want" is quite lispy
<wbooze>
hmmm
<wbooze>
that's a weird confusion of language
<wbooze>
a DSL could end up being anything
<wbooze>
it doesn't even have to be a language
<|3b|>
right, which is the point :)
<jackdaniel>
a common misconception is that "LISP -> obvious syntax"
peterhil has quit [Ping timeout: 260 seconds]
<jackdaniel>
or "trivial semantics"
<jackdaniel>
neither is true
<|3b|>
s-exp syntax was mostly an accident, and happened to be nice for a lot of things, but it isn't important for itself
<wbooze>
orly ?
<jackdaniel>
smlckz: I would, but coleslaw doesn't let me. I plan an overhaul sometime soon, so I'll keep taht in mind
shka has quit [Ping timeout: 260 seconds]
<wbooze>
hmmm
shka has joined #commonlisp
Gleefre has quit [Ping timeout: 272 seconds]
<wbooze>
mc carthy erm, what was his name again
<wbooze>
oh man
<wbooze>
right
<smlckz>
jackdaniel: hmm
<X-Scale>
|3b|: why do think s-exps aren't important for themselves?
<wbooze>
together with curch
<jackdaniel>
smlckz: generally coleslaw operates on templates, and base template that adds <title> is evaluated before post.title is introduced into the environment
<jackdaniel>
I could have hacked something, but I don't have time for that at the moment
<|3b|>
X-Scale: the things they are nice for are the important parts
<wbooze>
no wait, church was only onto lambda calculus, mc carthy it was, and by accident they mean it was some of his students who implemented it on some puter
<smlckz>
The theme of Rosetta code is 'programming chrestomathy', so I've used LOOP, DO and DOLIST.
<wbooze>
m-expressions nobody could get right, it's mentioned but no where used
<wbooze>
later on stuff like partial-eval got invented
<jackdaniel>
wbooze: you are quick to make unfunded statements
<wbooze>
i.e. higher-order logic stuff
<wbooze>
hmmm
<jackdaniel>
dylan is one example where they've switched from s-expressions to m-expressions
<jackdaniel>
then there is rhombus (I think) recently whipped by racket team
<wbooze>
i saw it mentioned only in some experimental stuff
<wbooze>
didn't knew dylan uses it
<jackdaniel>
yes, so claiming with confidence things you are not well versed with may be quite a brave strategy of communication (:
admich1 has quit [Ping timeout: 260 seconds]
<wbooze>
is dylan running on macs ?
admich1 has joined #commonlisp
<jackdaniel>
who knows? probably only folks developing opendylan and people who check their docs
<jackdaniel>
sexpressions are important to have sane macros
<jackdaniel>
imagine horrors induced by working on dum dum tokens
treflip` has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 272 seconds]
<|3b|>
i guess backquote could be considered another esoteric sublanguage (on the subject of how sane lisp macros actually are in practice)
mange has joined #commonlisp
<|3b|>
but again, "sane macros" is the important part, not sexp
Lord_of_Life has joined #commonlisp
treflip has quit [Ping timeout: 260 seconds]
<jackdaniel>
just like RPN notation makes forth amendable for being concatenative, sexps enable certain things to do with ease
<wbooze>
well, to be fair, i tried to like forth, but no go
<jackdaniel>
it is not to say that a concatenable language couldn't be implemented with such notation, but it would be certainly harder. similar -- I've heard that the only part dylan had problem with, with regard to implementing lisp features, were macros
<jackdaniel>
concatenative* I support
<jackdaniel>
s/with such/without such/
<wbooze>
if feels like backward speech
<wbooze>
hahaha
<jackdaniel>
well, it is actually forward speech. note that evaluation goes: first arguments, then the operator (at least in common lisp)
<X-Scale>
wbooze: have you tried Postscript?
<jackdaniel>
so (operator arg1 arg2) is actually backwards, because in truth it is arg1 arg2 operator
<wbooze>
hmmm, no not really X-Scale
dsgdsg has quit [Ping timeout: 260 seconds]
shawnw has joined #commonlisp
sammat has joined #commonlisp
jonatack has quit [Ping timeout: 268 seconds]
admich1 has quit [Read error: Connection reset by peer]
admich1 has joined #commonlisp
sammat has quit [Ping timeout: 272 seconds]
dsgdsg has joined #commonlisp
Guest47 has joined #commonlisp
sammat has joined #commonlisp
Gleefre has joined #commonlisp
lcn_ has joined #commonlisp
lusciouslover has quit [Quit: \]
rolling-lambda_ has quit [Quit: Bye!]
Gleefre has quit [Remote host closed the connection]
lusciouslover has joined #commonlisp
sammat has quit [Remote host closed the connection]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
<Alfr>
jackdaniel, but the function definition might be obtained before, between or after argument evaluation.
chomwitt has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
matt` has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
Everything has joined #commonlisp
dsgdsg has joined #commonlisp
lcn_ has joined #commonlisp
baby_groot is now known as phd_cat
johnjaye has joined #commonlisp
matt` has quit [Ping timeout: 248 seconds]
stirl has joined #commonlisp
mgl has joined #commonlisp
szkl has quit [Quit: Connection closed for inactivity]
ingeniot has joined #commonlisp
admich1 has quit [Ping timeout: 276 seconds]
ingeniot has quit [Ping timeout: 244 seconds]
admich1 has joined #commonlisp
gorignak has quit [Quit: quit]
gorignak has joined #commonlisp
weeks has joined #commonlisp
fart_cat has joined #commonlisp
Everything has quit [Quit: leaving]
bpanthi977 has joined #commonlisp
phd_cat has quit [Ping timeout: 260 seconds]
weeks has quit [Read error: Connection reset by peer]
bpanthi977 has quit [Ping timeout: 260 seconds]
rtypo has joined #commonlisp
dsgdsg has quit [Ping timeout: 260 seconds]
lcn_ is now known as donleo
cercopith has quit [Remote host closed the connection]
donleo has quit [Changing host]
donleo has joined #commonlisp
triffid has quit [Remote host closed the connection]
dsgdsg has joined #commonlisp
weeks has joined #commonlisp
dsgdsg` has joined #commonlisp
dsgdsg has quit [Ping timeout: 272 seconds]
mgl has quit []
<jasom>
With sbcl, if I pass --disable-debugger, it exits on unhandled errors, which I want; however is there any way to get it to print a backtrace first?
dsgdsg`` has joined #commonlisp
dsgdsg` has quit [Ping timeout: 252 seconds]
gorignak has quit [Quit: quit]
gorignak has joined #commonlisp
dsgdsg`` has quit [Ping timeout: 260 seconds]
Alfr has quit [Quit: Leaving]
rkazak has quit [Ping timeout: 248 seconds]
mesaoptimizer has quit [Remote host closed the connection]
gorignak has quit [Quit: quit]
gorignak has joined #commonlisp
istewart has joined #commonlisp
stirl has quit [Ping timeout: 260 seconds]
mesaoptimizer has joined #commonlisp
varjag has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.2)]
Alfr has joined #commonlisp
notzmv has joined #commonlisp
triffid has joined #commonlisp
chomwitt has quit [Ping timeout: 265 seconds]
Gleefre has quit [Remote host closed the connection]
notzmv has quit [Ping timeout: 260 seconds]
dajole has joined #commonlisp
rkazak has joined #commonlisp
gorignak has quit [Quit: quit]
gorignak has joined #commonlisp
admich1 has quit [Read error: Connection reset by peer]