pierpal has quit [Read error: Connection reset by peer]
dale has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
matzy_ has joined #lisp
matzy_ has left #lisp [#lisp]
matzy_ has joined #lisp
<aeth>
So I'm thinking about doing this for types for destructuring binds: (:destructuring (foo bar (baz quux)) (fixnum cons (integer vector)) list)
<aeth>
T would mean don't check-type/type-declare that particular thing (i.e. it's of type T). NIL would mean that part of the destructuring bind has no check-type/type-declare. So (foo bar nil) would be valid as would nil, but (foo bar t) or t would be invalid for that particular example.
<no-defun-allowed>
can freeotp be used for gitlab.c-l.net 2FA?
<aeth>
For options what I'll probably do is have a special (:options ...) item as an optional first "binding" so you can configure between check-type or type declarations. So it could be: (with-bindings ((:options :check-type t) (foobar integer 42) (:destructuring (foo bar (baz quux)) (fixnum cons (integer vector)) some-list) (:values (x y) (integer double-float) (floor 42.5d0))) ...)
<aeth>
The downside with this new flatter syntax (the old style would have been ((foobar integer) 42)) is that if you just want the ultra-binding with no types you'd have to say (foobar nil 42) or (foobar t 42) but I guess that means yet another macro, then. (6 total, then?)
<no-defun-allowed>
(additionally, why does gitlab have a PT?)
<aeth>
Oh and I think I'm going to go with (:values (x y) ...) instead of my original idea of copying SETF and using ((values x y) ...) just so there's a clear distinction between regular bindings and bindings that are fancy, i.e. each binding either begins with a symbol (treat it like a typed let) or a keyword, where the keyword is the fancy type of binding
<no-defun-allowed>
what's the minimum fixnum size?
<no-defun-allowed>
2^15-1 it is
<aeth>
That's most-positive-fixnum
<aeth>
That means the minimum fixnum size is 16 bits.
<aeth>
Because it's signed.
<no-defun-allowed>
yep, gotcha
<aeth>
So you can't actually implement Common Lisp on a 16 bit machine using traditional implementation techniques, but the minimums are essentially made with 16+ bits in mind, not 32-64
<no-defun-allowed>
lol
pierpal has joined #lisp
<aeth>
I'm guessing at the time they assumed there'd be 16-bit microcomputer Lisp machines that were actually at least 17-20 bits?
<no-defun-allowed>
presumably
<aeth>
Strange that they didn't raise the minimums in the 1994 standard, or if they did that they kept them so low.
<no-defun-allowed>
you might want to run common lisp on a PIC microcontroller though
<no-defun-allowed>
those were around then i think
<White_Flame>
16 bits is reasonable for a minimum address word
terpri has quit [Read error: Connection reset by peer]
<aeth>
I think the correct thing to do is to have three separate standard minima, for each bit size: 16, 32, and 64.
<aeth>
e.g. 60 bit fixnums for 64-bit or something.
<aeth>
Then you only need to know that you're using a 64-bit implementation and can then safely assume that e.g. docstrings can be longer than 1024 characters long
<aeth>
Although if done today you could drop the 16 bit.
elderK has joined #lisp
<elderK>
Moin all :)
<no-defun-allowed>
hey elderK
cross has joined #lisp
<elderK>
Hey NDA! :)
fikka has quit [Ping timeout: 245 seconds]
<elderK>
Going to rewrite my "epidemic" thingy today. To apply some of the feedback you guys gave me.
<elderK>
Also, might write a little macro, to see how they work in CL.
<elderK>
It'd be nice for instance, if I had a conditional increment, without having to write when all the time.
<elderK>
Might tinker with IO today, too
<elderK>
:D
pierpal has quit [Read error: Connection reset by peer]
arescorpio has joined #lisp
fikka has joined #lisp
pierpal has joined #lisp
fikka has quit [Ping timeout: 244 seconds]
<jcowan>
aeth: Scheme set the minimum fixnum limit to 24 bits, but that only affects the correctness of fixnum-specific operations, it does not constrain things like the sizes of strings. I wasn't there, but I assume 24 bits = 32 bits/word - a maximal 8-bit tag.
NB0X-Matt-CA has joined #lisp
shifty has joined #lisp
fikka has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
macaroni_destroy has quit [Quit: Ping timeout (120 seconds)]
macaroni_destroy has joined #lisp
pierpal has quit [Ping timeout: 245 seconds]
esrse has joined #lisp
<elderK>
Guys, how do you linebreak long parameter lists?
<loke`>
elderK: With a newline?
<loke`>
(that's probably nto what you were asking though)
<elderK>
:P
<elderK>
I was meaning like, is there some convention as to how to break them.
<loke`>
elderK: Emacs default indentaion implements what could probably be called “standard”
<elderK>
I don't use Emacs :P
<loke`>
elderK: Well, that's your problem right there. How else would you do Lisp development without an easy way to compile functions, etc.
<LdBeth>
elderK: then the CL implementation's pretty printing is the de facto standard
<loke`>
I can't even imagine what a nightmare it would be to develop in Lisp without Emacs. How would you even do it? You'd end up writinf code, and then manually load and compile eveeyr time. Probably restarting the runtime over and over again.
<elderK>
loke`: I'm using slimv. It's similar to SLIME.
<elderK>
LdBeth: Now that I've defined a couple macros, is there anything special I need to do to make sure like, everything works? Like, I've heard of eval-when.
<loke`>
elderK: Doesn't vim have Lisp indentation built-in?
<aeth>
jcowan: In CL, I think that "everything" in this category (e.g. array indices) has to be a fixnum and these things are normally positive, so in effect if fixnums are 2 ^ n then the upper bound for things like array-total-size-limit would be 2 ^ (n - 1) - 1. In SBCL, array-total-size-limit is 2 ^ 62 - 3. In CCL, though, it isn't anywhere close to the theoretical maximum iirc.
notzmv has joined #lisp
<LdBeth>
elderK: it's usually a good practice collecting macro definitions in one place and load them first
<loke`>
LdBeth: Why?
<aeth>
In practice they seem to have given extra room, so e.g. array-total-size-limit is 2 ^ 10 even though most-positive-fixnum has to be at least 2 ^ 15 - 1
<loke`>
Utility macros, sure. But those are not the only macros.
<LdBeth>
so one doesn't get bothered by eval-when
<loke`>
LdBeth: You don't need EVAL-WHEN when definiing a macro.
nckx has quit [Quit: Updating my GNU GuixSD server — gnu.org/s/guix]
<loke`>
You need it for functions that are used inside a macro.
<loke`>
(if the function is defined in the same file)
<aeth>
You only need eval-when for helper functions called by defmacro located in the same file as the defmacro iirc.
<aeth>
no-defun-allowed: I think that git is used in the recipe so that you can have dependencies that require being downloaded from git.
<no-defun-allowed>
probably yes
<no-defun-allowed>
hell yeah i only needed one try to get that to work
<LdBeth>
though CCL's famous for tricky behaviors on standard undefined aspects
<LdBeth>
the example is (some-macro (macrolet a b c)) where the argument form is just a list of symbol but ccl tries to expand it if some-macro defined in the same file is not warped in eval-when
<aeth>
no-defun-allowed: I would probably just comment out the part that requires git rather than removing it because once you need to load a dependency that is either not in Quicklisp or newer than the latest version in Quicklisp you're going to need it back in.
<Bike>
LdBeth: huh? if there's a defmacor some-macro ccl can't just ignore it
<aeth>
LdBeth: Perhaps there's a problem with order where if a defmacro foo is located below where it's used in the file CCL complains?
<aeth>
LdBeth: I definitely use macros in the same file where I define them all of the time with no problems
dddddd has quit [Remote host closed the connection]
orivej has joined #lisp
matzy_ has quit [Remote host closed the connection]
<LdBeth>
aeth: the actual situation is a little complex, the problem occurs when I use a custom code walker that idex symbols after macroexpand, and somehow ccl treats macrolet differently than sbcl that it tries to expand that form
<Bike>
so what's the part that's undefined behavior?
<elderK>
Is there a way to implement a do...while loop without using loop?
<elderK>
(do ...) seems to be a while loop.
<Bike>
loop does things left to right, so just put the "while whatever" at the end
<elderK>
Well, yeah, but I was wondering how I could do that without using loop.
<Bike>
not without doing the control flow yourself with tagbody.
<elderK>
Thank you :)
<elderK>
I'll stick with loop
<LdBeth>
Bike: function-information or something on ccl give different thing for macrolet than sbcl
<Bike>
cltl2 interface? that sounds very undefined indeed
<LdBeth>
so I'd rather eval-when some macro definition as a workaround.
igemnace has quit [Ping timeout: 272 seconds]
robotoad has quit [Quit: robotoad]
pierpal has joined #lisp
capadoodle has quit [Quit: Updating details, brb]
capadoodle has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
mathrick_ has quit [Ping timeout: 260 seconds]
_whitelogger has joined #lisp
igemnace has joined #lisp
robotoad has joined #lisp
mathrick_ has joined #lisp
<beach>
Good morning everyone!
<aeth>
elderK: You don't need to use tagbody, you can just write a macro on top of do
<elderK>
Good morning, beach!
<elderK>
:D I'm trying to learn how to debug stuff when it goes wrong.
<aeth>
elderK: If I'm understanding your problem correctly, you want a do that runs the body at least once, even if it would initially terminate. So (do () (t) (format t "Hello~%")) doesn't print "Hello~%" even once but you want it to show up once, correct?
<elderK>
So far, I've just been making sure my functions are reasonably small, so easy to "analyze". But, I have a bug now where stepping would be useful.
<elderK>
aeth: Correct
iomonad has joined #lisp
<elderK>
I wound up using Loop :)
<elderK>
I'm using some hand-rolled macros this time around too, although I'm not sure how much they're contributing. :P
<elderK>
Still, having fun :)
<beach>
elderK: Why were you trying to avoid LOOP initially?
<aeth>
elderK: That's as trivial as this: (defmacro foo (varlist endlist &body body) `(progn ,@body (do ,varlist ,endlist ,@body)))
<aeth>
elderK: So (foo () (t) (format t "Hello~%"))
<aeth>
That will work just like (do () (t) (format t "Hello~%")) but it executes the body once at the start.
<aeth>
It even preserves the return value of do
<elderK>
beach: No real reason, really. Just curiosity :)
<aeth>
Naming it, however, is harder. Do isn't a while loop... it's sort of a not-while loop, so do-while would be misleading.
<no-defun-allowed>
do-until?
<aeth>
Oh, not quite as trivial as I said because you'll also want a let for the bindings in the varlist
<elderK>
Naming is difficult :P
<aeth>
The bindings in the varlist have a step form so you have to actually parse the varlist
<aeth>
s/have a step form/can have a step form/
<aeth>
You could also have side-effects in the body.
<aeth>
If you wanted to use do* instead of do you could (afaik) avoid all of these issues with (defmacro foo (varlist endlist &body body) (let ((gensym (gensym))) `(do* (,@varlist (,gensym ,@body)) ,endlist (declare (ignore ,gensym)) ,@body)))
<aeth>
Just use loop.
rpg has joined #lisp
<elderK>
:) Roger that.
<aeth>
(loop behaves like do*, not do, so you're getting a similar effect, though)
khisanth_ has quit [Ping timeout: 268 seconds]
macaroni_destroy has quit [Ping timeout: 246 seconds]
<elderK>
When should I use values to return multiple things, instead of just using a cons to return two things?
<beach>
Always.
<beach>
VALUES does not allocate any memory.
<beach>
You should return a CONS or a list only if that is what you always want as a result.
<|3b|>
if you always need both things, and usually want to keep them around for a while, it might be worth putting them in some data structure
<elderK>
Also, can you do destructuring with a for in a loop?
<beach>
Yes.
<|3b|>
if you usually want 1 of the things, but sometimes need the other and have to calculate it anyway, use VALUES
<beach>
(loop for (a (c d) . e) in things do...)
jack_rabbit_ has joined #lisp
khisanth_ has joined #lisp
<elderK>
beach: What if I don't want to step along a list though?
<elderK>
Also, out of curiosity, is the "in things" evaluated once at the beginnign of the loop? Like, if I add more things to the list I'm moving over, will loop handle that?
<|3b|>
(loop for (a (c d) . e) = '(1 (2 3) . 4) ...)
<|3b|>
modifying structure of lists while iterating over them is generally undefined
<|3b|>
(and similar things for vectors, hash tables, etc)
<|3b|>
there are some specific modifications you are allowed to do, so check specs if it matters
<|3b|>
usually if i want to iterate a changing list i do something like (loop with tmp = list for x = (pop tmp) while tmp ...) or similar
<|3b|>
(possibly without the tmp, depending on whether you need the original value or not)
<on_ion>
rplaca ?
Bike has quit [Quit: Lost terminal]
<|3b|>
modifying the car of a cons doesn't change the structure of any lists it is part of, i think that is allowed while iterating a list
rumbler31 has quit [Remote host closed the connection]
<elderK>
Is there a return-from like call but for values?
<beach>
Notice in particular the definition of variable clause and main clause.
<beach>
A variable clause must precede a main clause.
<beach>
A FOR clause is a variable clause.
<elderK>
Yup. I was just reading that precise entry.
<elderK>
It seems that what I've written is sane, then.
<beach>
UNTIL is a main clause.
<elderK>
Yup
<beach>
So FOR can not follow UNTIL
<beach>
So it is not safe to interleave FOR and UNTIL.
<beach>
contrary to what you said.
<elderK>
Thank you
<beach>
It is important to read those Common Lisp HyperSpec entries, because the Common Lisp language is not defined by what an implementation accepts.
<beach>
Unless, of course, you don't care about writing non-conforming code.
<elderK>
No, I do care. Thank you.
* |3b|
hadn't thought about it previously, but i guess you could put loop-finish in a for = clause to terminate early for some of the cases where mixing them would be convenient
xkapastel has quit [Quit: Connection closed for inactivity]
<elderK>
:P I figure it's also not a wise idea to use loop as a more powerful let form :P
<on_ion>
other way around =P
<elderK>
So it's okay to use a loop without actually like, doing any looping? It's ability to like, destructure stuff is very, very useful.
<elderK>
And, well, I'd like to avoid destructured-bind + a let if I can.
<on_ion>
myself cannot live without destructuring and pattern matching
<on_ion>
(there is also cl-unification)
phoe has quit [Ping timeout: 240 seconds]
<elderK>
:) Are there any like, libraries or something worth studying to see how to do binary-IO well in CL? Say, parsing image formats and stuff?
<on_ion>
UIOP? there is a recent entirely-CL png loader
<elderK>
I've been pestering you all a lot today, so, I just wanted to say thanks. You guys have helped me so much, and have made jumping into Lisp much more enjoyable than it would be otherwise.
nowhere_man has quit [Read error: Connection reset by peer]
nowhereman is now known as Guest36813
<luis>
flip214: swank-presentation-streams has been very problematic in the past so it's basically unsupported at this point. We need a proper API from SBCL for this to ever work reliably
frgo has quit [Read error: No route to host]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
<elderK>
Guys, how do you do the equivalent of (define x (let ((stuff.)) (lambda (....) ....))) in CL?
fikka has quit [Ping timeout: 252 seconds]
<|3b|>
(let ((stuff)) (defun x ...)) ?
jochens has joined #lisp
<elderK>
Ah, cool :)
<elderK>
Thank you
<|3b|>
though usually i'd just make STUFF a global so i can debug it :p
<elderK>
:D That's what I wound up doing.
<elderK>
Still, thank you for showing me how to do let-over-lambda :)
<flip214>
luis: ack, thanks. still, slime/swank users typically don't know that ;/
fikka has joined #lisp
<luis>
flip214: what could we do? Rename it to something scary? Did you notice that there was some even fishier monkey patching going on? (#+#:disable-dangerous-patching) I thought that at that point the contrib had stopped doing anything interesting on SBCL
random-nick has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
smokeink has joined #lisp
<flip214>
propose a stable api?
hhdave has quit [Ping timeout: 244 seconds]
lemoinem has quit [Killed (barjavel.freenode.net (Nickname regained by services))]
lemoinem has joined #lisp
fikka has joined #lisp
rumbler31 has joined #lisp
lemoinem has quit [Read error: Connection reset by peer]
lemoinem has joined #lisp
rumbler31 has quit [Ping timeout: 250 seconds]
marvin3 has joined #lisp
frgo has quit [Remote host closed the connection]
<elderK>
:) Sweet, finished my solver for "Epidemic."
<elderK>
At least, as far as I care to go with it. I don't really need to read stuff from file.
<elderK>
Solution time is competitive with C++, too.
<elderK>
^_^ Nice
marvin2 has quit [Ping timeout: 252 seconds]
beach has quit [Disconnected by services]
beach has joined #lisp
beach has quit [Disconnected by services]
beach has joined #lisp
Guest36813 has quit [Ping timeout: 252 seconds]
Guest36813 has joined #lisp
dddddd has joined #lisp
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
themsay has quit [Ping timeout: 276 seconds]
razzy has quit [Ping timeout: 244 seconds]
<hypnon>
elderK: what kind of solver?
esrse has quit [Ping timeout: 244 seconds]
<elderK>
I guess you'd call it a solver for a cellular automaton kind of thing.
<elderK>
The "world" has certain rules that dictate how "disease" spreads.
<elderK>
The idea is, you are given a world of some configuration. Find out how to add to that such that after simulation, the entire world is infected. The goal is to use the minimum number of infected individuals.
<elderK>
It was the final assignment, a killer, for the a paper I did this semester.
<elderK>
I figured it would be a good thing to recreate in CL, as it's not trivial.
<elderK>
:D
<dim>
or just play a game of Pandemic with friends? ;-)
<elderK>
:
<elderK>
:P
ealfonso has quit [Ping timeout: 252 seconds]
ealfonso has joined #lisp
<hypnon>
elderK: ah, ok.
<elderK>
TBH, once you've "solved' it, it becomes trivial.
<elderK>
It was a real source of stress for me a few weeks ago :)
<luis>
flip214: definitely
ealfonso has quit [Ping timeout: 268 seconds]
anewuser has quit [Quit: anewuser]
robotoad has quit [Quit: robotoad]
shifty has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
nly has quit [Read error: Connection reset by peer]
<beach>
I think I may have gotten Quicklisp confused with an incorrect ASDF file. Is there a way to clear the idea that Quicklisp has of local projects, so that I can do the register-local-projects from scratch?
notzmv has joined #lisp
<jdz>
beach: have you tried removing the system-index.txt from local-projects? Or is it something else you're after?
<beach>
No, I haven't tried that, and that is probably what I am looking for.
<beach>
Thanks.
<beach>
Didn't work. Must be some other problem.
scymtym has joined #lisp
[[]] has joined #lisp
<[[]]>
hai
<bike>
good evening.
<flip214>
beach: touch the .asd files to make QL reload them
shrdlu68 has quit [Ping timeout: 250 seconds]
<beach>
It was a stupid mistake. I found it.
<beach>
Hello [[]].
<beach>
bike: Is that you Bike?
<bike>
it is me Bike.
<bike>
i think nickserv registrations are case independent.
<beach>
Oh, that's possible.
<bike>
maybe not, ns info lists "bike" as separate. hm.
elderK has quit [Quit: Connection closed for inactivity]
<beach>
[[]]: Are you new here? I don't recognize your nick.
<[[]]>
yes
<ecraven>
{{}}: is this your nick in lower case?
<[[]]>
no
<[[]]>
thats my nick in upper case XD
<ecraven>
according to rfc-1459, it is :P
<[[]]>
o..
<[[]]>
o.o *
beach has quit [Disconnected by services]
<ecraven>
RFC 1459: Because of IRC's scandanavian origin, the characters {}| are considered to be the lower case equivalents of the characters []\, respectively. This is a critical issue when determining the equivalence of two nicknames.
beach has joined #lisp
sjl_ has joined #lisp
<beach>
[[]]: So what brings you to #lisp?
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
rumbler31 has quit [Remote host closed the connection]
Guest36813 has quit [Ping timeout: 252 seconds]
<luis>
ecraven: it seems like this IRC server doesn't imlement that bit of the RFC
[[]] is now known as mobile_c
<ecraven>
luis: I've found comments that imply that freenode did implement this years back, but that might have changed
<ecraven>
(not that I'd advocate actually doing this, seems like madness ;D)
smokeink has quit [Ping timeout: 272 seconds]
heisig has quit [Quit: Leaving]
shenghi has quit [Ping timeout: 244 seconds]
shenghi has joined #lisp
Essadon has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
jetchisel has quit [Ping timeout: 264 seconds]
rippa has joined #lisp
mobile_c has quit [Read error: Connection reset by peer]
mobile_c has joined #lisp
Guest36813 has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
razzy has joined #lisp
Inline has joined #lisp
anamorphic has joined #lisp
beach has quit [Ping timeout: 252 seconds]
SumoSud0 has quit [Ping timeout: 276 seconds]
SumoSud0 has joined #lisp
johnjay has joined #lisp
status402 has quit [Quit: status402]
asarch has joined #lisp
pierpal has joined #lisp
Guest36813 has quit [Ping timeout: 264 seconds]
Zaab1t has joined #lisp
beach has joined #lisp
jkordani has joined #lisp
xkapastel has joined #lisp
frgo has quit [Remote host closed the connection]
carmack has quit [Ping timeout: 268 seconds]
carmack has joined #lisp
fikka has joined #lisp
Oladon has joined #lisp
Guest36813 has joined #lisp
cage_ has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
nowhere_man has joined #lisp
Guest36813 has quit [Ping timeout: 276 seconds]
razzy has quit [Ping timeout: 240 seconds]
frgo has joined #lisp
wusticality has joined #lisp
nowhere_man has quit [Ping timeout: 250 seconds]
fikka has joined #lisp
frgo has quit [Ping timeout: 276 seconds]
kuwze_ has joined #lisp
Necktwi has quit [Quit: Lost terminal]
fikka has quit [Ping timeout: 252 seconds]
another-user has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
Oladon has quit [Ping timeout: 245 seconds]
Oladon has joined #lisp
nitrowheels has joined #lisp
anamorphic has quit [Quit: anamorphic]
another-user has quit [Remote host closed the connection]
frodef has joined #lisp
dhis has joined #lisp
anamorphic has joined #lisp
<dhis>
Hello. I'm using CFFI and I'm able to load some shared libraries, but I sometimes get an error that the library is dependent on another library. I'm not clear on how to use the library designator in define-foreign-library. Is there a CFFI example for this? I'm thinking if I give a complete list of libraries it will load the library.
shifty has quit [Ping timeout: 252 seconds]
jack_rabbit_ has quit [Ping timeout: 250 seconds]
fikka has joined #lisp
mobile_c has quit [Read error: Connection reset by peer]
<TMA>
dhis: I have been bitten by that already. the solution is to load the depended-on library first. there is some dependency autoloading, but it fails too often to be reliable
pjb has joined #lisp
<dhis>
TMA: Yes I did try loading some libraries first (that didn't depend on anything else) and that is ok. I guess some of my libraries depend on each other, in a cyclical way.
<TMA>
dhis: the autoloading is "whatever the underlying operating system does"
Kaisyu has quit [Quit: Connection closed for inactivity]
ted_wroclaw has joined #lisp
<TMA>
dhis: I have no advice to cyclic dependencies besides: "avoid cyclic dependencies"
lumm has joined #lisp
nowhere_man has joined #lisp
<wusticality>
morning all
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
potatonomicon has quit [Read error: Connection reset by peer]
jochens has quit [Ping timeout: 245 seconds]
k-hos has joined #lisp
m00natic has quit [Remote host closed the connection]
<pjb>
it would be nicer if the block were cut vertically under the opening parenthesis, instead of being flushed to the left margin. (As long as no printing character in the list are present between those two columns of course).
wilfredh has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
sauvin has quit [Ping timeout: 244 seconds]
<kuwze_>
pjb: well it's definitely possible to highlight only part of it... at least I know evil c-v seems to imply that
Zaab1t has quit [Ping timeout: 244 seconds]
Zaab1t has joined #lisp
kushal has quit [Remote host closed the connection]
kushal has joined #lisp
SaganMan has quit [Quit: good night]
anamorphic has quit [Quit: anamorphic]
anamorphic has joined #lisp
asarch has quit [Quit: Leaving]
lemoinem is now known as Guest19447
Guest19447 has quit [Killed (asimov.freenode.net (Nickname regained by services))]
lemoinem has joined #lisp
scymtym has quit [Ping timeout: 276 seconds]
anamorphic has quit [Client Quit]
anamorphic has joined #lisp
kuwze_ has quit [Ping timeout: 256 seconds]
razzy has joined #lisp
kyby64 has joined #lisp
scymtym has joined #lisp
orivej_ has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
nitrowheels has quit [Quit: Leaving]
robotoad has joined #lisp
kristof has joined #lisp
<kristof>
in my DIY understanding of implementing lisp I continually run into things that make me go "oof, how do I even make that fast?"
<kristof>
today's topic: struct inclusion.
Zaab1t has quit [Quit: bye bye friends]
<kristof>
reader functions generated by a defstruct form are guaranteed to work correctly on any struct that includes its parent. in a statically typed language this is a simple matter because the offsets are the same
<kristof>
however... typechecking is now this ugly overhead on struct access when the type is unknown.
<kristof>
a simple eq check on the part of the data structure that holds the type is insufficient because I need to check ancestors now, too.
<kristof>
So I'm thinking I... first check if the type is what I expected. And if it isn't, I check the type object's ancestor. And I keep following that chain until I hit T. Right?
<jackdaniel>
since you can't recompile structures you may have constant offsets
Zaab1t has joined #lisp
<jackdaniel>
so if C = {x,y} includes D = {a,b,c}, then layout would be {a,b,c,x,y}
<kristof>
yeah, that's not the slow part, it's the typecheck when I don't have type information through inference or declare
<kristof>
but I guess the old advice remains the same. If you want it to be fast, declare declare declare.
fikka has quit [Ping timeout: 268 seconds]
rozenglass has quit [Read error: Connection reset by peer]
ealfonso has joined #lisp
themsay has joined #lisp
<kristof>
I haven't even begun to think about classes yet.
random-nick has quit [Ping timeout: 264 seconds]
themsay has quit [Ping timeout: 244 seconds]
<bike>
yeah, typep with a class basically means checking the class precedence list of the class of the object.
xkapastel has joined #lisp
cage_ has quit [Quit: Leaving]
ggole has quit [Quit: ggole]
<pfdietz>
Ancestry queries in trees can be done with two comparisons (compare pre and post order traversal numbers).
<pfdietz>
x is an ancestor of y iff pre(x) < pre(y) and post(x) > post(y).
<jackdaniel>
clever
random-nick has joined #lisp
kuwze has quit [Ping timeout: 256 seconds]
heisig has joined #lisp
fikka has joined #lisp
ryan_vw has joined #lisp
aeth has quit [Ping timeout: 246 seconds]
aeth has joined #lisp
<anamorphic>
API design question: I have a function (origin foo) => x, y (i.e two values) and I'm writing a corresponding (defun (setf origin) (new-value foo) ..) Would it be a better design if new-value was an array of two numbers, or would it be better if it were a list?
makomo has quit [Ping timeout: 268 seconds]
<anamorphic>
or a cons, or a (defstruct point (x y) ...) I guess a struct would make the get and set congruent
<heisig>
anamorphic: Unless your API is used from the innermost loop of an HPC application, you should use generic functions and (defclass origin () ...).
<heisig>
Or (defclass point () ...)
frgo has joined #lisp
<heisig>
CLOS is surprisingly fast and makes your code much more maintainable in the long run.
<anamorphic>
Hmm yeah
frgo has quit [Ping timeout: 244 seconds]
makomo has joined #lisp
ealfonso has quit [Ping timeout: 252 seconds]
ealfonso has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
kristof has quit [Ping timeout: 246 seconds]
<sjl_>
For the record: you can define a setf function that can set multiple things at once without an extra datastructure: (setf (origin foo) (values 1 2))
<sjl_>
But if you want to represent something with a data structure, then yeah a class is generally a good choice. Only use a struct if you've benchmarked and it's a bottleneck.
<anamorphic>
Hmm I'll check look again. I thought it wasn't possible
theseb has joined #lisp
<theseb>
is there a diff between a "function" and an "operator" in lisp?
<theseb>
me thinks they are the same thing
<theseb>
they both "map inputs to outputs" yes?
<sjl_>
operators can be macros or special operators like if
<pjb>
theseb: function ⊂ operator.
<theseb>
pjb: nice
<pjb>
macros and special operators may do something else than mapping input to outputs. It's not "operator" in the mathematical sense.
<theseb>
pjb: "something else" == side effects?
<pjb>
yes, but also, flow control.
<anamorphic>
sjl_, so something like (defun (setf origin) (new-values foo) (multiple-value-bind (x y) new-values ...)?
<pjb>
for example looping, alternative, concurrence, etc.
<pjb>
So no mapping.
<sjl_>
anamorphic: I think you'll need to use define-setf-expander
<sjl_>
I don't think you can use defsetf or (defun (setf ...) ...) for this.
<sjl_>
But maybe I'm wrong
<bike>
you can use defsetf with multiple values
<sjl_>
Oh nice
<anamorphic>
OK thanks, I'll take a look at defsetf
<sjl_>
Oh yeah I always forget defsetf has a long form
<theseb>
if anyone has any experience with large lisp dev teams......i'm curious how they maintain *readability* if the gurus start using lots of macros
<theseb>
and DSLs
<White_Flame>
domentation, well-named things
<White_Flame>
*documentation
<theseb>
makes sense
<sjl_>
The docstrings for my hairier macros are often as long or longer than the macros themselves
<White_Flame>
and there should be libraries of macros, not just randomly scattered ones
<White_Flame>
well, there should be libraries, not necessarily just of macros
<White_Flame>
and they don't even have to be separate .asd files, just collected and documented together
<pjb>
theseb: readability comes from the fact that all operators have nice names, such as WITH-OPEN-FILE or CHAR-CODE, and that the name of the opertor is the first element of each sexp = symbolic expression = list.
<pjb>
theseb: also, lispers don't usually shoot themselves in the foot, since it hurts.
<White_Flame>
if there are one-off macros, they should be inside a macrolet, not defmacro
<pjb>
Meaning, we choose good names.
<theseb>
sounds good
<pjb>
theseb: everything in C is hard, even obfuscation. This is why there is a C obfuscation contest. But there's no lisp obfuscation contest, because it's too easy to obfuscate lisp code.
<theseb>
heh
<theseb>
pjb: seems to me ....a lisp dev team couldn't risk hiring average people....for what you said
<White_Flame>
using Lisp should be exercising your skills of abstraction, because anything can be done at the source code level. Thus, it's reasoanble to assume that Lispers will experience good & bad abstraction consequences and git gud at it
<pjb>
well average people are obnubiled by the parentheses…
ted_wroclaw has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
confusedwanderer has left #lisp [#lisp]
<theseb>
lisp teams always need a top notch crew just like in Fast & Furious
<pjb>
The problem is even hiring too top-notch.
<theseb>
pjb: wait..how can a crew be "too" top notch?
<pjb>
The problem with teams, is that they need some homogeneity.
ealfonso has quit [Ping timeout: 276 seconds]
_spm has quit [Remote host closed the connection]
<pjb>
For example, in the expendables, everybody in the team is old and muscular. If there was a baby, you could make N old muscular men and a coffin, but not the expendables.
<theseb>
pjb: hmm..not sure how we could control the more clever impulses of the 3 comma programmer
<pjb>
theseb: easy: hire N 3-, lispers. Make a team of 3-, lispers.
<LdBeth>
does ecl works with avr-gcc?
<pjb>
Good question. Better asked in #ecl. I have no idea. What is avr-gcc?
<theseb>
pjb: The minute a team lead says..."OK we are going to limit what you are allowed to do for readability".....then they are moving towards Python
<theseb>
..i.e. restricted powers in the same of readability
<LdBeth>
pjb: it's a C compiler for microcontrollers
<pjb>
Definitely.
<pjb>
What can be said against 3-, is that it shows a lack of abstraction. The 3-, programmer has more capabilities, to be able to understand, write and read 3-, expressions. This allows him to use them, instead of introducing abstractions.
<theseb>
pjb: it is sort of like a reverse Greenspun's rule..."Every large enough lisp dev team contains a half baked spec of a Pythonic language"
<pjb>
I don't think. I feel that lisp allows you to write more complex software using fewer brain cells.
<pjb>
You don't need to remember a lot, since the syntax is simplier and clearer. And you don't need to understand a lot, because of the abstractions used in lisp programs. 3-, goes against that.
<pjb>
LdBeth: Your question is whether ecl is ported to avr. Again, I don't know, but if not, it should be easy to define avr as a target of ecl, AFAIK.
<anamorphic>
Aren't AVRs 8-bit microcontrollers with ~KBs of RAM?
<LdBeth>
yes, so the question is can ecl produce really compact code to run on a microchip
<pjb>
That could be a problem. libecl.dylib is 3407 KB (on this 64-bit macOS).
<anamorphic>
I doubt it, LdBeth
<pjb>
the binaries of your own code can be small, but it links with libecl…
<anamorphic>
You might be interested in https://ferret-lang.org/ though. I was just reading about it. It supports AVR boards
<pjb>
If you're RAM limited, you would need something like Wukix MoCL or like clicc.
<anamorphic>
Yeah I like ulisp better syntax wise. ferret looks like clojure
cgay has quit [Ping timeout: 252 seconds]
themsay has joined #lisp
rozenglass has joined #lisp
<theseb>
pjb: no my point is to manage lots of people you need to *restrict* them.
<theseb>
pjb: restricted hamstrung lisp == python
shka_ has quit [Ping timeout: 268 seconds]
<jasom>
theseb: "...then they are moving towards Python" this is absolutely not true. Readability is important and good abstractions are a net-gain in readability.
vlatkoB_ has quit [Remote host closed the connection]
<jasom>
theseb: A common lisp style suggestion is "Don't use a macro when a function will do" which doesn't bring lisp even a tiny bit towards python, but is a net gain for maintainability.
<theseb>
jasom: i heard another suggestion which was...do as much of the macro in a normal function as possible..then just make a macro wrapper for it
<theseb>
jasom: does that sound right
<jasom>
theseb: I've heard that one; probably not as universal as the one I said. In any event, you can place limits on what programmers can do without hamstringing the language
anamorphic has quit [Quit: anamorphic]
<jasom>
theseb: in fact you could take your theoretical "pythonized lisp rules" and add "... except when necessary" to the end of each rule and already have something both restrictive, but more powerful than python.
<jasom>
(note this is a thought experiment, I think pythonizing lisp is not a good starting point).
anamorphic has joined #lisp
robotoad has quit [Quit: robotoad]
Zaab1t has quit [Quit: bye bye friends]
robotoad has joined #lisp
Oladon has quit [Quit: Leaving.]
heisig has quit [Quit: Leaving]
jmercouris has joined #lisp
<jmercouris>
how to loop through element in like (loop for element in list do ...) and have index of element within do part?
<jmercouris>
I seem to remember needing to have two clauses, but I can't remember how it should look
<jkordani>
for i upto (length list)...?
dhis has quit [Quit: Page closed]
<jmercouris>
jkordani: and then nth on each element in the list?
<jmercouris>
nvm, I misunderstood you
rumbler31 has joined #lisp
<jmercouris>
jkordani: that's what I was looking ofr yes
<jmercouris>
s/ofr/for, this stupid macbook keyboard
<anamorphic>
jkordani: you can do it this way too: (loop for i from 0 for elem in list do ...)
<jkordani>
ah thats very nice
rumbler31 has quit [Remote host closed the connection]
* anamorphic
luv loop
<jmercouris>
anamorphic: very cool
<jmercouris>
I have a sort of love/hate relationship with loop
<jmercouris>
I really like it, I am just so unskilled with it
<jmercouris>
I wish I just knew it better, but it seems like there is so much to learn about it
<anamorphic>
Yeah same
<jmercouris>
and don't even get me started about format
<jmercouris>
there is so much packed into that...
moei has quit [Quit: Leaving...]
neirac has quit [Remote host closed the connection]
<anamorphic>
jmercouris: Have you tried out the alternatives, e.g. iterate and series?
<jmercouris>
anamorphic: no, not in great depth
<jmercouris>
though I guess it is pretty divided between the two camps
<jkordani>
format is fun too.
jmercouris has quit [Remote host closed the connection]
anamorphic has quit [Quit: anamorphic]
random-nick has quit [Read error: Connection reset by peer]
robotoad has quit [Quit: robotoad]
Oladon has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
<PuercoPop>
loke`: oi, just found stumpwm-dbus, can you share your setup config? Should I look at anything in particular beyond the formatter?
<aeth>
I'm very disappointed by iterate.
<aeth>
I thought it was just loop with s-expressions, but it's not, so it has an unnecessary learning curve and is unnecessarily complicated.
<aeth>
It also apparently only works with iterate:foo symbols, which doesn't really work well with the new style of not using :use for arbitrary packages. It should work on keywords.
<aeth>
I might write a loop-with-s-expressions and call it do-loop or something
<aeth>
i.e. (loop :for x :in y :collect (1+ x)) would just become (do-loop (:for x :in y) (:collect (1+ x))) and it would be a strict superset of loop so you could easily port loop clauses by adding parentheses.
<aeth>
As opposed to iterate's 43 page PDF manual
anamorphic has joined #lisp
<aeth>
The downside (other than having to, in effect, implement loop or port an implementation of loop) would be that it might not be sufficiently s-expressioned (s-expressed?). e.g. (:for-in x y) is Lispier than (:for x :in y)
<aeth>
(Of course, if it's a superset of loop, (:for x :in y) could be transformed to the preferred (:for-in x y))
<White_Flame>
it's still lispy, as in (defun for (var &key in) ...)
<aeth>
White_Flame: That's unordered, though.
<White_Flame>
destructuring-bind can do keywords, too, iirc
<aeth>
White_Flame: If implemented with destructuring-bind that permits (:for x :then (* 3 x) := 1 :of-type fixnum)
<White_Flame>
maybe LOOP requires the ordering, but nothing semantically in that list of options does
<aeth>
White_Flame: But, yeah, superset means that might be allowed
rozenglass has quit [Ping timeout: 272 seconds]
theseb has quit [Remote host closed the connection]
bike has quit []
<aeth>
White_Flame: I use keywords to implement a loop-like sum macro (for integer summation).
angavrilov has quit [Remote host closed the connection]
nicksmaddog has quit [Quit: Leaving]
<aeth>
Better iteration might be my next utility library task after better bindings.
themsay has quit [Read error: Connection reset by peer]
<aeth>
White_Flame: I would keep the order for LOOP's sections, and might even make them explicit with ()s like (do-loop ((:for x :in y) (:for a :in b)) ...)
themsay has joined #lisp
<aeth>
The advantage is that that makes the sections explicit, the disadvantage is that that makes it harder to port existing LOOPs
kyby64 has quit [Quit: Leaving]
themsay has quit [Ping timeout: 252 seconds]
CrazyEddy has quit [Remote host closed the connection]
slac-in-the-box has joined #lisp
slyrus2 has joined #lisp
<jcowan>
Today I read a claim that ACL2 is the most successful CL application ever; anybody have comments on that?
<LdBeth>
Once it should be cl-http
<aeth>
jcowan: Maxima seems pretty popular
<luis>
What's the metric? Number of users? Revenue dollars?
<LdBeth>
The user of a verification program is definetly small than a CAS
<LdBeth>
^ group
<aeth>
I think Maxima is the only Common Lisp application in Fedora, and it might be a similar situation with other distros.
Kaisyu has joined #lisp
jochens has joined #lisp
jochens has quit [Ping timeout: 268 seconds]
<luis>
How about Crash Bandicoot and its 50 million copies? (Not all versions used Lisp though.)
comborico1611 has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
<LdBeth>
GG
<LdBeth>
Then we could say most games on iQue Player
<LdBeth>
because at that point they use C compiler written in KCL
Oladon has quit [Quit: Leaving.]
slyrus2 has quit [Ping timeout: 268 seconds]
lumm has quit [Quit: lumm]
ryan_vw has quit [Ping timeout: 250 seconds]
sjl_ has quit [Quit: WeeChat 2.3-dev]
jiby has joined #lisp
Bicyclidine is now known as Bike
<jiby>
hey all, is there any way to tell asdf/ql to force reload a package?
<jiby>
I've changed my exports (removed one, added other instead) in a trivial pkg and the removed exported symbol is "missing" all the time
<jiby>
I get that exported symbols would be very stable over time (who's silly enough to change their interface!? =p)
<jiby>
but I'm running out of caches to clear
<Bike>
jiby: with asdf you can :force t or :force :all
<Gnuxie[m]>
(ql:register-local-projects)
<jiby>
neat, I'll try those!
nirved has quit [Quit: Leaving]
<jasom>
jcowan: ACL2 is very successful in its niche, but it's a small niche.
<jiby>
I'll be damned, neither worked to clear my exported symbol. Loading it again shows the same thing: caught WARNING: ; CL-YOUR-PKG also exports the following symbols: ; (CL-YOUR-PKG:MAIN)
<jasom>
jcowan: it's probably the only current day CL application for which it is the "one to beat"
<jasom>
jiby: you need to first delete the package, then tell asdf to reload the system
<jiby>
I doubt there is anything special about "main" as a symbol, correct?
<jasom>
jiby: asdf deals in systems, not packages.
<jiby>
jasom: thanks for the info, I'll dig in that direction
oni-on-ion has joined #lisp
<jasom>
jiby: (delete-package 'cl-your-pkg) (asdf:load-system :force t "my system that defines cl-your-pkg")
<jasom>
jiby: (delete-package 'cl-your-pkg) (asdf:load-system "my system that defines cl-your-pkg" :force t)
<pillton>
Sometimes it is useful to do (asdf:load-system "system" :force :all).
<jiby>
wow, hardcore. Seems to have cleared the exported symbol! thanks guys! Am I correct in assuming there is a big assumption of "thou shall not remove a symbol from your export" wrt. compatibility?
Essadon has quit [Quit: Qutting]
<PuercoPop>
loke`: For some reason overriding the stumpwm-dbus:popup-timeout doesn't appear to affect the durationg the timeout is displayed.
<jasom>
jiby: I don't think so (there is unexport, for example). However, static analysis tools are confused by exported symbols not in the defpackage, which is probably why SBCL warns.
<jiby>
fair, the warning is early on, and turns into a big fat compile error down the line. it's starting to make sense
<jasom>
ah "If the new definition is at variance with the current state of that package, the consequences are undefined"