<definite>
Should I install stumpwm via quicklisp or my distro's package manager?
dmiles has quit [Remote host closed the connection]
<no-defun-allowed>
quicklisp would be more up to date
<definite>
no-defun-allowed: Thanks.
dmiles has joined #lisp
rumbler31 has quit [Remote host closed the connection]
<aeth>
Personally I directly build it from the git repo
anewuser has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 244 seconds]
dale has quit [Quit: dale]
<definite>
aeth: Why?
Kundry_Wag has joined #lisp
<aeth>
because the build process is just ./autogen.sh && ./configure && make
<aeth>
iirc
<aeth>
strange to see something that's 99% Lisp be built that way, though
Bike has quit [Ping timeout: 252 seconds]
lemoinem has joined #lisp
Bike has joined #lisp
<Blackbeard>
definite: you can also use Guix
<definite>
Blackbeard: I was considering installing GuixSD, but everything is difficult with free drivers. I suppose I could use the package manager alone (I've heard that suggestion before, more commonly for Nix + Haskell).
<aeth>
definite: nvidia GPU?
<definite>
Speaking of Guix, why is there a Scheme distro and no Common Lisp one (AFAIK, I'd be happy to be corrected) if CL is always advertised as the "full-featured systems language" of the two?
<Blackbeard>
definite: you don't need guix sd though
<Blackbeard>
you can install guix in top of any distro
<Blackbeard>
definite: probably because it uses Guile, the GNU extension language
<aeth>
definite: What really makes a distro is the package manager and its software respositories... So I guess the only thing is that people haven't written a Unix package manager in CL (or at least not one that has any major adoption)
<definite>
aeth: No, my Thinkpad has a whitelist of available WiFi cards and the one that I got to replace the old one isn't on it. I'm looking into bypassing it, but the only guide I've found which promises not to brick my computer is really old. Blackbeard: More of a question for the CL people.
<definite>
no-defun-allowed: Which Thinkpad is that? I got a T400 just to Libreboot it, but apparently you have to take apart the entire thing. I'm considering getting an X200 (only have to take off casing next to keyboard to access flashchip) and relegating this one to server duty.
<no-defun-allowed>
he doesn't say which model
<no-defun-allowed>
it links to a x220 guide though
regreg_ has joined #lisp
Arcaelyx has joined #lisp
robotoad has joined #lisp
robotoad has quit [Read error: Connection reset by peer]
robotoad has joined #lisp
NB0X-Matt-CA has quit [Remote host closed the connection]
NB0X-Matt-CA has joined #lisp
regreg_ has quit [Ping timeout: 252 seconds]
<aeth>
ironclad seems pretty cool.
warweasle has quit [Quit: night]
<aeth>
Strange that it doesn't use setf where it should, though
robotoad has quit [Ping timeout: 260 seconds]
<aeth>
It does seem to at least on the surface be idiomatic and optimized other than that.
Kundry_Wag has quit [Remote host closed the connection]
<Demosthenex>
so what do they mean the symlink support is broken?
<Demosthenex>
seems like a strong assertion, but i don't see the basis, did i miss something?
eminhi_ has quit [Ping timeout: 245 seconds]
<shka_>
symlinks in fads are broken?
gector has joined #lisp
<jackdaniel>
Demosthenex: the thing is that iolib depends on posix interfaces (via ffi)
<jackdaniel>
while cl-fad depends on whatever implementation gives it
<jackdaniel>
I believe that's what David means
<jackdaniel>
osicat is another solution (it is also ffi based, but it doesn't libfixposix) which behaves thesame on all implementations
lanu has joined #lisp
nowhereman_ has quit [Ping timeout: 252 seconds]
nowhere_man has joined #lisp
Balooga_ has joined #lisp
heisig has joined #lisp
<Shinmera>
I forget, but do osicat and iolib work on windows?
<jackdaniel>
I'm sure osicat does
<jackdaniel>
and I *think* iolib is posix-specific (so on windows that would be cygwin/msys)
robotoad has quit [Quit: robotoad]
makomo has quit [Ping timeout: 252 seconds]
nanoz has quit [Ping timeout: 260 seconds]
asarch has quit [Quit: Leaving]
jgoss_ has quit [Quit: Leaving]
rumbler31 has joined #lisp
<Demosthenex>
hrm.
<Demosthenex>
i appreciate the feedback.
<Demosthenex>
i thought ffi would be less portable really
<jackdaniel>
ffi gives you uniform behavior, because you aim directly at your operating system interfaces
<jackdaniel>
pathnames and file access otoh are underspecified in CL standard
<jackdaniel>
so there are divergencies on how these chapters are interpreted by different CL vendors
<Demosthenex>
i thought iolib used a library called iolib, not posix.
<Demosthenex>
not sure where i got that impression
<jackdaniel>
iolib uses library called libfixposix which fixes some inconsistencies between POSIX implementations (hah!)
gector has quit [Ping timeout: 252 seconds]
<Demosthenex>
yeah, so not universally available
<jackdaniel>
that's why I've mentioned osicat as alternative
<Demosthenex>
i'd have used the default or cl-fad, but i don't do much with files atm, still learning
<Demosthenex>
it only came up because i was discussing finding files in a dir via wildcard with Blackbeard
<jackdaniel>
I'm using cl-fad with a great success myself
gector has joined #lisp
<Demosthenex>
cheap plug: i'm loving stumpwm. its so cool to be able to connect slime to my WM and update it live
lanu has quit [Remote host closed the connection]
lanu has joined #lisp
<Demosthenex>
and being able to port over several pages of lua code for awesomewm for my window management into a single function was enlightening
nowhere_man has quit [Ping timeout: 252 seconds]
nowhere_man has joined #lisp
quazimod1 has joined #lisp
quazimod1 has quit [Client Quit]
angavrilov has joined #lisp
* |3b|
wonders if there is any easy way to get printer to use #n= #n# for keywords too
shrdlu68 has joined #lisp
<|3b|>
trying to make a large file smaller, currently saves ~50MB with normal *print-circle* on individual forms, but still lots of repeated keywords
<|3b|>
though i guess if N got too large, some of them might get longer
<shrdlu68>
Compress?
<|3b|>
well, it's lisp source, so sort of inconvenient to compress beyond whatever git does
<heisig>
Just for fun, have you tried converting the data to a single quoted literal in a file and compile it to a fasl? Then the compiler would coalesce the shared structure for you :)
<|3b|>
maybe i should just leave it as 108MB of readable source instead of 50MB of line noise :p
<|3b|>
fasl isn't really suitable for checking into git repo though, particularly if i ever want to upgrade my lisp :)
<|3b|>
it's ~15MB .fasl file though
<heisig>
Heh :)
scymtym has quit [Ping timeout: 244 seconds]
* |3b|
could also try to combine circularity between forms, but that would probably require writing it out and reading back in, which would lose formatting
<|3b|>
(though i guess if i'm losing readability to #x# i might as well dump formatting too)
<shka_>
heisig: yeah, i did that
<Shinmera>
|3b|: Still not as big as the fasl qtools generates if you precompile all qt method wrappers
<|3b|>
something like 4.5k defpackage forms + same # of forms to specify how to call the methods named by the packages
orivej has joined #lisp
<ggole>
I'll bite: what is it?
<|3b|>
Shinmera: the 15M or the 50/108MB?
<|3b|>
15MB isn't too bad
<Shinmera>
|3b|: the 15MB. Qtools' q+ file is 50MB for the base libs
<|3b|>
ggole: i'm writing a cl-like compiler targeting dalvik bytecode, and this is the FFI definitions for the android APIs
<Shinmera>
at least, if I remember correctly. Been years since I tried it.
<|3b|>
Shinmera: maybe i should just generate the .fasl directly from the .jar file and check that in instead
<Shinmera>
By default, wrappers are compiled on the fly as needed.
<|3b|>
its only ~31mb i think
<|3b|>
though probably a bit slower to load jar, parse it and generate package defs than to read and compile the generated lisp file
<ggole>
Good old FFI, always elegant and painless
<|3b|>
yeah :/
* |3b|
can compile hello world though :)
<ggole>
Nice
<Shinmera>
looks like your work is done to me
<|3b|>
compiler has exactly enough to compile calls to a superclass, or to methods of arbitrary class, passing either arguments to the method being defined or literal integers, assuming all have type declarations :p
<|3b|>
and to call constructor of superclass
<|3b|>
which is enough to define an onCreate method that sets the view to a hello world screen defined as a resource
anunnaki has quit [Ping timeout: 252 seconds]
* |3b|
can't actually build a dex or apk file out of it yet though :(
<|3b|>
though some of that stuff is written too, just not attached to the compiler
anunnaki has joined #lisp
<Shinmera>
what's your ultimate end-goal? The Android API is so unbearable that I don't know if even writing Lisp could fix that
<|3b|>
few small utilities, like scanning a barcode and sending to a web server, and also playing with the android AR stuff
<|3b|>
maybe some simple games depending on what sort of performance i get out of it
<Shinmera>
Seems a bit extreme to start by writing a compiler to me
<|3b|>
:)
<beach>
I think it's an excellent idea.
<Shinmera>
It's commendable for sure
<beach>
It also means more clients for Cleavir/SICL. :)
<|3b|>
don't really /need/ the barcode thing, and the AR stuff is as much for fun as anything, so if i'm having similar fun writing compilers i might as well :)
<Shinmera>
Fair enough
<|3b|>
hmm, parsing the .jar file is only ~2sec if it doesn't spam debug prints, that isn't too bad
<Shinmera>
I was just having horror flashbacks to writing Ocelot, an Android client for the Lichat protocol
* |3b|
wonders how hard it would be to build the defpackage and ffi info directly from it instead of printing it to a file
<|3b|>
(and how fast)
<|3b|>
hopefully i can at least improve a bit over normal android workflow
<|3b|>
not sure how hard it would be to get a monitor running on android that i could send chunks of code to for interactive dev from slime
* |3b|
things it has an API for runtime loading from memory, but not sure how it interacts with attempts at redefinition. might need a dev mode where stuff calls stubs i can redefine or something
<|3b|>
that and GC of old code, which i think is recent if supported at all
<|3b|>
s/things/thinks/
<|3b|>
also want nicer DSLs for all the resource stuff, though that will require some thought
frgo has joined #lisp
rumbler31 has quit [Remote host closed the connection]
thijso has joined #lisp
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
gravicappa has joined #lisp
nowhere_man has quit [Ping timeout: 252 seconds]
SaganMan has quit [Read error: Connection reset by peer]
Balooga_ has quit [Quit: Balooga_]
igemnace has quit [Read error: Connection reset by peer]
<shka_>
so you were saying that you want to have multithreaded computations in petalisp
<shka_>
is using lparallel for it is a good idea in your opinion?
igemnace has quit [Quit: WeeChat 2.2]
Kaisyu has joined #lisp
scymtym has joined #lisp
flamebeard has joined #lisp
flamebeard has quit [Remote host closed the connection]
troydm has joined #lisp
flamebeard has joined #lisp
flamebeard has quit [Remote host closed the connection]
<phoe>
I have a CLOS design question.
<beach>
YES!!!!
<beach>
:)
<phoe>
I have a protocol class named MESSAGE. It's going to be subclassed many times to create concrete classes representing different kinds of the messages in my system.
<phoe>
Messages are also going to have responses - if there's a message named HELLO, then there are going to be responses named (OK HELLO) and (ERROR HELLO).
<no-defun-allowed>
i have a clos/mop question too but it's less interesting
<phoe>
no-defun-allowed: ask it, c'mon
<no-defun-allowed>
well i want to create a class programatically, so i can take a netfarm schema and create an equivalent CLOS class
<shka_>
phoe: cliff hanger ;-)
<jackdaniel>
I have one too: is it spelled like /si/los or /k/los ;]
<beach>
"pronounced" you mean?
<Shinmera>
no-defun-allowed: just use COMPILE instead
<jackdaniel>
yes
<no-defun-allowed>
i pronounce it like clause
<phoe>
I kind of want a dual inheritance scheme, where each message can be named after its class - HELLO, LOGIN, LOGOUT, SEND, ... and so on
<beach>
jackdaniel: Both exist.
<no-defun-allowed>
compile?
<no-defun-allowed>
why compile?
<jackdaniel>
I know, it was a joke (apparently not obvious)
<Shinmera>
no-defun-allowed: produce defclass sexprs and call compile
<phoe>
But I also want each message to have this "state" - it can either be a normal message (NIL), be a confirmation to an earlier message (OK) or an error reply (ERROR)
<beach>
phoe: How is that "dual"?
<shka_>
phoe: operation, query, response?
<no-defun-allowed>
okay, but is there another way of doing it?
<shka_>
like that?
<Shinmera>
(plus funcall)
<no-defun-allowed>
what does defclass actually do?
<shka_>
phoe: i think that you can simply create operation class and then have generic function called message that will simply dispatch on operation and accept &rest arguments
m00natic has joined #lisp
<phoe>
Anyway - in my use case, I'll have messsages named HELLO, (OK HELLO), (ERROR HELLO), LOGIN, (OK LOGIN), (ERROR LOGIN), ...
<beach>
no-defun-allowed: Try (make-instance 'standard-class) for instance.
<phoe>
Shinmera: you're right
<no-defun-allowed>
okay
<shka_>
phoe: why do you need messages as objects?
<no-defun-allowed>
nice!
<beach>
phoe: So what seems to be the design problem?
<phoe>
Anyway - it makes sense to me to have mixins for MESSAGE, OK-MESSAGE and ERROR-MESSAGE, and then the hierarchy HELLO, LOGIN, LOGOUT, SEND, ...
<heisig>
shka_: I am not sure whether I will use lparallel for managing my threads or not. It is certainly a great library. I use it mostly for its utilities, like queues and promises.
<phoe>
But this means that I'll need to define classes like HELLO, OK-HELLO, ERROR-HELLO, ..., which causes me to define 3*n classes in total. This looks like combinatorial explosion to me.
<shka_>
heisig: thanks for answer!
<phoe>
So it doesn't look like I should do it with mixins.
<shka_>
phoe: can i suggest solution?
<phoe>
shka_: so I can process them with CLOS dispatch.
<phoe>
shka_: yes! That's why I ask the question.
<shka_>
so i would start with operation class, not message
<Shinmera>
phoe: what I do in Lichat is I define error classes for specific circumstances and tag every message with a unique id that others can reference
<shka_>
and operation instances are basicly inmutable
<no-defun-allowed>
okay, so i need to create some slot definitions now
<Shinmera>
so I don't need error and ok variants for every message
<shka_>
then you can define message class that has two slots: operation and status
<shka_>
then you define fundamental-status
<shka_>
once this is done, you can have error-status, ok-status etc.
<beach>
no-defun-allowed: It is a bit involved to do that. You need to read that page and a few more to understand what you need to do.
<shka_>
your message is composed out of those two
<phoe>
shka_: this sounds sane.
<shka_>
since multimethods are awesome, you can manage your logic this way
<shka_>
and simply dispatch on two classes
<no-defun-allowed>
yes, i suppose i will have to do a lot of reading
<phoe>
To avoid creating statuses, I could use keywords and EQL specializers, methinks. (NIL :OK :ERROR) sound like a good choice.
<shka_>
so you have top level of message that is simply wrapper around two objects
<phoe>
Yes, I see.
<shka_>
yes, this is any option
<shka_>
not sure what else would you want
<no-defun-allowed>
"Initialization of Slot Definition Metaobjects" seems most relevant here.
<shka_>
but I would probabbly roll with the classes anyway
<shka_>
it is simply what i prefer
<Shinmera>
no-defun-allowed: slots are also represented by classes, of course
<shka_>
i don't think that this is objectivly better choice
<phoe>
shka_: my status would be a very dumb object though, it's literally a member of (NIL :OK :ERROR).
<shka_>
well, ok
<Shinmera>
or rather slots on a class are represented by slot instances
<no-defun-allowed>
yes, that is what i noticed.
<phoe>
Thanks!
<shka_>
in that case it may be a good idea indeed
<shka_>
anyway, you can simply abstract this in make-message where you are accepting operation and status symbol
<shka_>
underneath you can construct instance (or not)
<shka_>
this way you can quickly swap implementation underneath if needed
<shka_>
because :error appears to be something that should contain some sort of description of what wen wrong
<shka_>
while operation holds information on what you were trying to do
<phoe>
That's what goes in the message body
<shka_>
ok
<no-defun-allowed>
making slots and classes seems quite circular
<no-defun-allowed>
i might need to do more reading but to make the slot you need the class definition and to make the class you need the slot definition
<phoe>
no-defun-allowed: obviously, CLOS is implemented in Lisp
<phoe>
no-defun-allowed: you might want to read AMOP, where a CLOS-like object system is implemented in raw CLOS-less Common Lisp
<shka_>
phoe: glad i could help!
<no-defun-allowed>
yeah, what's that got to do with anything?
<no-defun-allowed>
oh
<no-defun-allowed>
as previously mentioned, i've got no money for books
<phoe>
basically, you can go from a CLOS-less Common Lisp to a CLOS-ful Common Lisp using nothing but the facilities embedded in the language
<shka_>
no-defun-allowed: CLOS is sort of framework to implement all sorts of object systems
<shka_>
it has it's default implementation and it is really nice, but it is not the only possible
<beach>
no-defun-allowed: make-instance does not take slot metaobjects.
<beach>
no-defun-allowed: It take "canonical direct slot specifications"
<beach>
You need to read up on what those are.
<no-defun-allowed>
well, this will be fun.
<beach>
no-defun-allowed: I am in the middle of implementing CLOS, so I have much of that relatively fresh in my head. So let me know if you need help.
<no-defun-allowed>
how do i create a canonical direct slot specification then?
igemnace has joined #lisp
<beach>
no-defun-allowed: If you had read up on that, you would have seen that they are just lists.
<no-defun-allowed>
yes, sbcl gave me a type error requiring a list
<beach>
no-defun-allowed: That entire site is just the free part of the AMOP book.
<beach>
... HTML-ized.
<no-defun-allowed>
amazing
<no-defun-allowed>
also double #< notation is quite funny
regreg_ has joined #lisp
<Demosthenex>
so anyone here using sly? worth trying as a n00b, or functional enough to get by?
<jackdaniel>
some people are using it (here included) and they seem to like it more than slime
<Xach>
Demosthenex: it has a lot of cool features and is probably easier to try for someone new than someone with a lot of slime muscle memory
<jackdaniel>
if I had to gues most people use slime though
<jackdaniel>
guess*
rumbler31 has joined #lisp
<Xach>
I want to use sly more but I have a tension between wanting to be as productive as I am with slime and learning a different way
<Shinmera>
The one thing I don't know is how well/quickly sly takes over changes to slime
<Xach>
takes over changes?
<Shinmera>
since some implementations like sbcl and clasp change pretty often
<Shinmera>
and the imlementors only fix slime
<Xach>
oh
<Demosthenex>
the main page says they import fixes, but obviously there would be a delay
<phoe>
Is there any way to print only N first characters of an object's printed representation?
<phoe>
*print-length* doesn't seem to do what I want.
<Demosthenex>
phoe: bet there's a format recipe
<jackdaniel>
you could try to print it to string and subseq it
<phoe>
For (1234567890) if I want to print only five chars, I'd like to get "(1234.." or something similar
<Shinmera>
Demosthenex: don't think so.
<Shinmera>
could write a gray stream, of course
rumbler31 has quit [Ping timeout: 250 seconds]
<jackdaniel>
mere fact that you are not 100% certain shows how large format is
<jackdaniel>
four riders of the apocalypse: loop, format, clos and clim, none intelligible (half joking ;)
jruchti has quit [Ping timeout: 240 seconds]
<Demosthenex>
i'm hoping to work on clos with my son tonight
<Demosthenex>
he's been making a text game
<Demosthenex>
we got into arrays and starting defstruct...
<Demosthenex>
i may blow thru defstruct and goto classes ;]
<phoe>
good luck!
<phoe>
jackdaniel: xD
<Demosthenex>
blew his mind how i tried to talk about object inheritance
<Demosthenex>
its nice to see someone keen to learn it
jruchti has joined #lisp
<jackdaniel>
phoe: if you make something of your own, take into account, that if it fits it sits. if you'd like to have at most 5 characters, then it would be "(12.."; but for (123) you should have full "(123)"
<jackdaniel>
having "(12.." would be awkward given 5 char limit and string of length 5
<Xach>
It's even more fun with variable-width glyphs
<jackdaniel>
speaking of a devil
<jackdaniel>
I'm implementing rotations in ttf renderer
<Xach>
like a transform matrix etc?
<jackdaniel>
yes (for mcclim)
<jackdaniel>
based on zpb-ttf of course (and cl-vectors)
<Xach>
fun! i did that for vecto. cl-vectors has no transforms, just rendering.
<Shinmera>
3d-matrices already has that stuff
<Xach>
trivial-transforms
<Shinmera>
so you could copy its methods since you probably don't use it in itself
<jackdaniel>
Shinmera: do they have xlib glue, glyph-set, text advance stuff etc?
<jackdaniel>
transformation itself is quite trivial indeed
<Shinmera>
no, why would it
<Xach>
Shinmera: you seemed to be offering it as a solution?
<jackdaniel>
McCLIM has quite elaborate transformations api which as everything one would need (given we take only transformations into account)
<Shinmera>
Xach: for matrix transforms, since that was the topic, yea
<Xach>
Shinmera: oh, that is so easy you could almost accidentally write it from scratch every time!
<Xach>
while trying to write a text truncation system!
<no-defun-allowed>
reverse leftpad!
<Shinmera>
yea, which is why there's already so many matrix-y libs out there (plus innumerable ad-hoc ones, I'm sure)
igemnace has quit [Quit: WeeChat 2.2]
<Demosthenex>
hrm, format has padding but not truncation?
lavaflow_ has joined #lisp
igemnace has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<jackdaniel>
Xach: will you accept PR for vecto which would add save-array function?
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zfree has joined #lisp
<jackdaniel>
currently software renderer uses cl-vectors, but vecto api looks like a hit for it
<jackdaniel>
(I'm asking for the future, I'm not planning to work on that at the moment)
<cods>
Xach: hi. Is someone maintaining cl-vectors these days? I doubt it was perfect as is :)
<cods>
I was supposed to convert the documentation to something more usual at some point, but never took the time to do it.
Josh_2 has joined #lisp
braintropy has joined #lisp
eminhi has joined #lisp
braintropy has quit [Quit: braintropy]
edgar-rft has quit [Remote host closed the connection]
<Xach>
cods: thank you, by the way, for making cl-vectors etc perfect so quickly, because i have been able to use it for so many happy things over the years
shrdlu68 has quit [Read error: Connection reset by peer]
<Xach>
cods: my latest project involves making real roadside signs out of vinyl, paint, and wood, and it started from a program powered by cl-vectors
<jackdaniel>
Xach: will you be willing to accept such PR? or there is already a way to achieve that?
<eminhi>
Hi, I'm browsing sbcl source and came across, (declare (explicit-check)). What is this used for?
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #lisp
<jackdaniel>
eminhi: it looks like sbcl-specific interface. probably enforces checking declared variable types despite (i.e) succesful inference
<no-defun-allowed>
I guessed the opposite but that's less reasonable: type checks are explicitly required.
<no-defun-allowed>
That would be (safety 0) though.
<scymtym>
jackdaniel: eminhi: it means arguments should not be checked against the declared ftype in the function prologue because the function body will perform an explicit check (hence the name) and error signaling itself
<jackdaniel>
scymtym: uhm, thanks for the explanation
<eminhi>
scymtym: jackdaniel: Thank You
esrse has quit [Ping timeout: 246 seconds]
<eminhi>
sbcl has many instance of code like, (defun 1+ (number) (declare (explicit-check)) (1+ number). recursive without checks?
anewuser has quit [Quit: anewuser]
<eminhi>
some thing very weird is going on with explicit-check.
<beach>
eminhi: As I understand it, there are primitives that are directly known by the compiler, like CAR and CDR. I guess 1+ must be one of them.
<beach>
eminhi: So no recursion involved.
trittweiler has quit [Ping timeout: 252 seconds]
<eminhi>
so the namespaces are different for compiler code and defun symbols?
<beach>
No, it's that (1+ number) does not mean "Call the function 1+ with the number" to the compiler. It means, generate code for what you already know about 1+.
igemnace has quit [Ping timeout: 268 seconds]
<eminhi>
What happens when 1+ is used elsewhere in the same file? compiler generate code or defun application?
Kaisyu has quit [Quit: Connection closed for inactivity]
<beach>
I am not the right person to answer, because I don't know the details. But, as I understand it, wherever 1+ is used in a function-call position, like (1+ <any-form>), the compiler recognizes 1+ and just generates code for what it means.
<eminhi>
is explicit-check enabling this behaviour?
<no-defun-allowed>
The same logic applies. If the function is declared inline, the compiler can optimise as much as it wants out of it.
<scymtym>
eminhi: 1+ is present as an ordinary function (in case it is called indirectly) and as compiler-level construct, a "source transform" (SLIME's M-. will show all of those). the function is implemented in term of the source transform, therefore the apparent recursion
<scymtym>
eminhi: asking SBCL-specific questions in #lisp is not the best approach. study the code and ask in #sbcl if you get stuck
igemnace has joined #lisp
<eminhi>
scymtym: Thank you. define-source-transform clarifies this a bit. I'll join #sbcl
<eminhi>
beach: Thank you.
<beach>
Sure.
<no-defun-allowed>
How does :initfunction work in the canonical direct slot specification work?
<no-defun-allowed>
By the looks of things initform is pretty useless and initfunction is a thunk which evaluates to the wanted default value.
<Xach>
jackdaniel: i would accept the pr, sure. you can snoop on the 8-bit sample image data by using :: right now but I understand the interest in a supported option.
Essadon has joined #lisp
<no-defun-allowed>
Goodnight.
igemnace_ has joined #lisp
igemnace has quit [Ping timeout: 252 seconds]
igemnace_ is now known as igemnace
cl-arthur has joined #lisp
igemnace has quit [Quit: WeeChat 2.2]
graphene has quit [Remote host closed the connection]
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
graphene has joined #lisp
SenasOzys has quit [Ping timeout: 240 seconds]
dddddd has joined #lisp
SenasOzys has joined #lisp
astronavt has joined #lisp
Bike has joined #lisp
astronavt_ has joined #lisp
astronavt has quit [Ping timeout: 260 seconds]
Kundry_Wag has joined #lisp
random-nick has joined #lisp
frodef has quit [Ping timeout: 240 seconds]
heisig has quit [Quit: Leaving]
roshanavand has joined #lisp
rnmhdn has joined #lisp
warweasle has joined #lisp
P1RATEZ has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
skeuomorf has joined #lisp
Guest5800_ has joined #lisp
Younder has quit [Quit: Leaving]
Younder has joined #lisp
thetemplar has joined #lisp
astronavt_ is now known as astronavt
cage_ has joined #lisp
warweasle is now known as warweasle_afk
Nephromancer has joined #lisp
nowhere_man has joined #lisp
LiamH has joined #lisp
m00natic has quit [Remote host closed the connection]
igemnace has joined #lisp
nowhere_man has quit [Ping timeout: 240 seconds]
SenasOzys has quit [Ping timeout: 240 seconds]
skeuomorf has quit [Ping timeout: 268 seconds]
rnmhdn has quit [Ping timeout: 272 seconds]
rnmhdn has joined #lisp
flamebeard has joined #lisp
flamebeard has quit [Remote host closed the connection]
asarch has joined #lisp
flamebeard has joined #lisp
frodef has joined #lisp
flamebeard has quit [Read error: Connection reset by peer]
rippa has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
SenasOzys has joined #lisp
varjag has joined #lisp
warweasle_afk is now known as warweasle
wigust has quit [Ping timeout: 252 seconds]
lemoinem is now known as Guest70944
lemoinem has joined #lisp
edgar-rft has joined #lisp
Guest70944 has quit [Ping timeout: 252 seconds]
lemoinem is now known as Guest60708
Guest60708 has quit [Killed (hitchcock.freenode.net (Nickname regained by services))]
lemoinem has joined #lisp
gravicappa has quit [Ping timeout: 272 seconds]
mgsk has joined #lisp
<mgsk>
Anybody know how to define a foreign key in postmodern using dao-class?
orivej has joined #lisp
skeuomorf has joined #lisp
pjb has joined #lisp
anewuser has joined #lisp
FreeBirdLjj has joined #lisp
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
zfree has quit [Remote host closed the connection]
razzy has quit [Ping timeout: 260 seconds]
kyby64 has joined #lisp
jack_rabbit has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
dueyfinster has joined #lisp
FreeBirdLjj has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 268 seconds]
dueyfinster has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Younder>
Does anyone here do DNN's in CL? Seems to me AI has moved on.
<phoe>
Younder: DNN?
<Younder>
MXNet has an interface which is feasible.
<Younder>
phoe, Deep Neural Nets
Kundry_Wag has joined #lisp
bigfondue has quit [Ping timeout: 252 seconds]
shrdlu68 has quit [Ping timeout: 244 seconds]
doubledup has joined #lisp
shrdlu68 has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
<Younder>
Well, I'll work on that then. An MXNet interface to CL might be instructive. (I normally use Mathematica)
razzy has joined #lisp
nowhere_man has joined #lisp
vlatkoB has quit [Remote host closed the connection]
shifty has joined #lisp
bigfondue has joined #lisp
rnmhdn has quit [Ping timeout: 264 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
frodef has joined #lisp
veinoflockedout is now known as veinofhashome
eminhi has quit [Remote host closed the connection]
X-Scale has quit [Ping timeout: 252 seconds]
beach has quit [Ping timeout: 252 seconds]
X-Scale has joined #lisp
robotoad has joined #lisp
cage_ has quit [Quit: Leaving]
rnmhdn has joined #lisp
<phoe>
What would be the best pattern to only capture the kind of errors that happens as a part of DESTRUCTURING-BIND operation?
<phoe>
CLHS says it signals ERROR, which is very non-specific.
<jasom>
phoe: it's going to be implementation-specific unfortunately; this looks like someone needs to write a "trivial-bind-error" package :P
<phoe>
I'm wondering if I can somehow wrap the destructuring-bind body in some handlers that will only apply to whatever happens inside the d-b binding forms.
<phoe>
Some interesting handler-bind trickery.
<jasom>
phoe: that would still catch errors thrown on the "right side" of the binding
<djeis[m]>
Add dynamic variables and you might be able to pull that off...
<jasom>
e.g. (destructuring-bind (foo) (error ...) ...)
<phoe>
jasom: not really - a handler may decline to handle it.
<phoe>
A dynavar might be what I need in that case.
<djeis[m]>
...gensymmed local special...
<djeis[m]>
Ow.
<djeis[m]>
That hurts me more than a little.
<phoe>
No, that would work, too.
<jasom>
lexical vars are doable too
<jasom>
(let ((in-bind t)) (handler-bind ... (destructuring-bind X Y (setf in-bind nil) ...)))
<phoe>
That sounds good
dale_ has joined #lisp
<jasom>
but you know with a macro and gensyms and stuff
<djeis[m]>
Yea, I suppose, if you wrap the Y as well in a progn/prog1.
dale has quit [Disconnected by services]
dale_ is now known as dale
<jasom>
djeis[m]: Y doesn't need to be wrapped, as it's identical in usage to destructuring-bind
<phoe>
I assume I could simply shadow CL:DESTRUCTURING-BIND with my own implementation that uses this trickery and is guaranteed to signal some DESTRUCTURING-BIND-ERROR when the binding fails.
<djeis[m]>
Depends if you want to catch errors raised by Y itself and not just the binding process.
<phoe>
But still, (destructuring-bind (x y) (error 'error) ...)
<phoe>
djeis[m]: I wouldn't want to be caught
<phoe>
want that to be caught*
<jasom>
djeis[m]: oh!
<djeis[m]>
Right, so you’d either want to move that outside your handler bind using a gensym or you’d need to wrap that too.
<jasom>
(let (in-bind) (handler-bind ... (destructuring-bind X (prog1 Y (setf in-bind t)) (setf in-bind nil) ...)))
<djeis[m]>
Yea, that could do it.
<djeis[m]>
Well...
<djeis[m]>
No.
<Bike>
you could ask your implementation(s) nicely
thetemplar has quit [Ping timeout: 244 seconds]
<phoe>
Bike: unless you want a solution that doesn't #+sbcl (...) #+ccl (...) #+ecl (...)
<djeis[m]>
Keep in mind that there could be optional/key rules in the lambda list.
<Bike>
well, i mean, coordinate it
<phoe>
djeis[m]: why should I keep that in mind?
<Bike>
i'm just thinking it's probably not a huge change
<djeis[m]>
Do you want to catch errors from evaluating the defaults?
<phoe>
djeis[m]: hm
shrdlu68 has quit [Ping timeout: 268 seconds]
<djeis[m]>
And I don’t see a simple way around that one, actually, that doesn’t involve parsing a lambda list.
<Younder>
Look this is all ugly. You gotta restate the problem rather than rephrase the answer.
<phoe>
I am destructuring a list and I want to capture the kind of errors that happen when a list cannot be destructured.
<phoe>
I want to handle the DESTRUCTURING-BIND-ERROR condition that was not included in the CLHS.
<Younder>
The way I would do it is to paste destructing-bind-error, rename it and add it to your program in a portable way.
<Younder>
After adding the functionality. Because the problem will probably turn up again.
rnmhdn has quit [Ping timeout: 272 seconds]
<phoe>
paste?
<Younder>
ugly, but it works
robotoad has quit [Quit: robotoad]
<Younder>
I wish we had pjb here. He would have a more elegant solution.
dbjergaard has joined #lisp
<phoe>
pjb: ^
<dbjergaard>
Hi, I'm trying to load unit tests using fiasco and I cannot for the life of me get asdf to load it
random-nick has quit [Ping timeout: 240 seconds]
<phoe>
dbjergaard: are you using Quicklisp?
<dbjergaard>
the package to be tested was made with quickproject
<dbjergaard>
is the result of trying to do (ql:quickload :indras-tests)
thetemplar has joined #lisp
<dbjergaard>
ah! it worked
<dbjergaard>
now I've got another problem, but that's an actual "you wrote wrong code you dummy" problem
<dbjergaard>
thanks!
<aeth>
phoe: If you're only supporting a few implementations you could handle this with #+sbcl, #+ccl, #+ecl, etc. You would still need to think about which kinds of errors could happen, e.g. passing (list) to (a b c) gives an arg-count-error (and it looks like that's for defmacro lambda lists so internally they must have the same or a similar implementation) in SBCL, but that's probably not the only possible error
makomo has joined #lisp
<aeth>
(If you're doing this as part of an application, then it's probable that your libraries already made the choice for you and your program can probably only run on SBCL and CCL and maybe ECL. If you're doing this as part of a library, you're going to have to support a longer list, but even that's only like 6-8 or so.)
robotoad has joined #lisp
<phoe>
aeth: I'll try to do it portably.
<scymtym>
if you are willing to invest the effort, maybe try to make a protocol for generating destructuring forms (along the lines of CLtL's PARSE-MACRO, but more specific) instead. only standardizing the error condition seems like a lot of work for comparatively little gain
<aeth>
Well, just run invalid destructuring-binds and see what you get. #+sbcl sb-kernel::arg-count-error #+ccl ccl::simple-program-error #+ecl simple-error #+clisp system::simple-program-error #+abcl program-error
<aeth>
This only is problematic in #+abcl because SLIME isn't giving me the package, just the name, and program-error isn't in cl-user
<jasom>
aeth: apropos
orivej has joined #lisp
<jasom>
aeth: or you know just (handler-case ...) and return the error
<aeth>
looks like it's system::program-error
<aeth>
There are some issues with just seeing what you get. SBCL might be too specific, i.e. you might get something else with a different invalid list passed in if that's possible (try cases with &key and &rest and &body).
<aeth>
And ECL has the opposite problem... seems away too general.
<phoe>
What did I get wrong in this FORMAT call?
<phoe>
(format t "Failed to destructure ~S against ~S~:[.~;~%~A~]" '(a b) '(2) "haha")
<jasom>
aeth: are your sure it's not cl:program-error?
<aeth>
jasom: it could be both
<aeth>
you're probably right
<scymtym>
phoe: you need ~%~:*~A in the end as ~:[ consumes one argument
<phoe>
scymtym: thanks
<jasom>
phoe: ~[ consumes an argument
<jasom>
you can use ~@[ instead phoe, scymtym
<jasom>
oh no you can't because you're doing ~;, nevermind
Kundry_Wag has joined #lisp
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
skeuomorf has quit [Ping timeout: 252 seconds]
rumbler31 has joined #lisp
random-nick has joined #lisp
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
rumbler31 has quit [Ping timeout: 244 seconds]
robotoad has quit [Quit: robotoad]
lnostdal has quit [Ping timeout: 252 seconds]
nowhere_man has joined #lisp
lnostdal has joined #lisp
ggole has quit [Quit: ggole]
Kundry_Wag has quit [Remote host closed the connection]
frodef has quit [Ping timeout: 252 seconds]
trittweiler has joined #lisp
Bike has quit [Ping timeout: 256 seconds]
scottj has left #lisp [#lisp]
dbjergaard has quit [Remote host closed the connection]
igemnace has quit [Ping timeout: 240 seconds]
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
robotoad has joined #lisp
asarch has quit [Remote host closed the connection]
dented42 has joined #lisp
<phoe>
I think I got my destructuring-bind* in a decent shape
<trittweiler>
I'm a bit perplexed by what the point of this is, but assuming it's some kind of learning experience: please note LOCALLY won't be enough because locally only supports free declarations, not declarations of bindings. The bind-modify-lambda-list can also probably be written cleaner.
<phoe>
trittweiler: right, I'll need to extract the declarations from the body if there are any
<phoe>
trittweiler: and yes, bind-modify-lambda-list is dirty but works
<Shinmera>
time for form-fiddle (or similar)
<phoe>
trittweiler: also not really a learning experience, I realized that I have a use case where I want to capture errors that may happen during destructuring, and the standard doesn't let me do that easily.
rumbler31 has quit [Remote host closed the connection]
dmiles has quit [Ping timeout: 272 seconds]
logicmoo has joined #lisp
random-nickname has quit [Ping timeout: 268 seconds]
jack_rabbit has joined #lisp
random-nickname has joined #lisp
arbv has quit [Ping timeout: 245 seconds]
arbv has joined #lisp
astalla has quit [Ping timeout: 245 seconds]
random-nickname has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
astalla has joined #lisp
jasmith has quit [Quit: Leaving]
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
astalla has quit [Ping timeout: 246 seconds]
skeuomorf has joined #lisp
skeuomorf has quit [Ping timeout: 244 seconds]
Josh_2 has joined #lisp
nowhere_man has quit [Ping timeout: 268 seconds]
skeuomorf has joined #lisp
tich-k has quit [Remote host closed the connection]
angavrilov has quit [Remote host closed the connection]
panji has joined #lisp
nowhere_man has joined #lisp
anewuser has joined #lisp
skeuomorf has quit [Ping timeout: 245 seconds]
Achylles has joined #lisp
panji has quit [Read error: Connection reset by peer]
nowhere_man has quit [Ping timeout: 246 seconds]
P1RATEZ has quit []
trittweiler has quit [Ping timeout: 260 seconds]
trittweiler has joined #lisp
Essadon has quit [Quit: Qutting]
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.1)]
rtypo has joined #lisp
<aeth>
Oh, cool, someone ported one of Steve Russell's old projects to (a descendant of) another one of Steve Russell's old projects. https://www.guerra-espacial.rufina.link/
mrblack has joined #lisp
nowhere_man has joined #lisp
anewuser has quit [Ping timeout: 244 seconds]
<mrblack>
hi everyone... I'm following the book "Land of Lisp" on Debian, and it tells me to install the "clisp" package. Unfortunately, this package is not part of Stable anymore, so I installed sbcl after a suggestion I got in #emacs. So my question is: when the book tells me to run "clisp", will I have any trouble if I use "sbcl" instead? I mean, will I be able to follow the same instructions and get the same result?
<djeis[m]>
For a lot of code, very probably.
<mrblack>
cool
<djeis[m]>
Most code is portable.
<mrblack>
another question
<mrblack>
just for the sake of it
<mrblack>
would if too hard to install Clisp from source?
<mrblack>
*would it be to hard
<djeis[m]>
Honestly? No clue.
<mrblack>
I have experience installing stuff from source, as long as there are good instructions for me to follow
<Bike>
i think clisp is reaosnably easy to build
<jasom>
mrblack: IIRC it's ./configure && make && make install
<djeis[m]>
What's clisp master actually like these days?
<Bike>
lisp code that works in clisp will almost certainly work in sbcl. the command line switches will be different, but i don't know if LoL uses those
<djeis[m]>
Cus they haven't had a proper release in a while, IIRC.
<aeth>
mrblack: There is one chapter that requires CLISP iirc. The web server chapter or something like that.
<mrblack>
aeth, yeah, he says that in the introduction.
<aeth>
mrblack: generally ime you'll find things to be the other way around, where they work on SBCL but not on CLISP.
<mrblack>
hummm.... I understand. Even in the context of this book?
<djeis[m]>
I'd suggest just doing the rest of the book on SBCL and figuring out the web server when you get to it tbh.
<djeis[m]>
Because I suspect that anything that book says about web servers is outdated at this point.
<mrblack>
okay!
<mrblack>
so the sbcl is better anyway, is that it?
<djeis[m]>
Well, compared to the last actual release of clisp? Definitely.
<mrblack>
awesome
<mrblack>
one more: do you guys use Emacs for lisp? If so, do you have any links and recommendations for it?
<aeth>
mrblack: ime the issues I've had recently with trying to test a short portable program in CLISP were in LOOP (where CLISP either deviates from the standard or SBCL/CCL/ECL do) and in declaring something to be the type of a struct (not sure if structs don't create a type in CLISP or if I would have to wrap the defstruct in an eval-when to also run it at compile time to get the declaration to be valid)
<aeth>
mrblack: I don't think either would be an issue in the context of working through an introductory book that was written with CLISP in mind
<oni-on-ion>
real lispers dont LOOP
<djeis[m]>
lol
<mrblack>
aeth, I don't know what most of those things mean lol
<aeth>
right, fairly advanced stuff
<aeth>
Portability issues tend to happen in rare corners of the language
<oni-on-ion>
which might make you think CL is such a waste in all the conforming efforts
<oni-on-ion>
undefined behaviors, implementation-dependant functionality, whats the use of a standard? to have a #channel of course
<djeis[m]>
Yea, but for port code portability is both possible and reasonable.
<djeis[m]>
*most code
<oni-on-ion>
that is how i still feel
<mrblack>
aeth, My motivation to learn lisp is to do stuff on Emacs, so I doubt I'll ever get to this advanced stuff that created you problems
<oni-on-ion>
but it is always talked about, implementation this and that. ironically being a CL channel
<Bike>
you are aware that emacs lisp is not what land of lisp is about?
<mrblack>
Bike, yes, of course.
<Bike>
k good
<oni-on-ion>
most of it applies to elisp Bike , it is not too far off.
<adlai>
mrblack: (require 'cl) should get you a workable common lisp within emacs
<Bike>
more far off than the distance between clisp and sbcl, certainly
Oladon has joined #lisp
<oni-on-ion>
i feel that CL and elisp are similar in most respects/regards
<oni-on-ion>
ehh really ??
<mrblack>
Bike, I'm using a Common Lisp resource because it is a good resource, educational wise... I don't like the Elisp specific materials very much
<Bike>
as long as you're aware, it's probably fine
<adlai>
mrblack: be warned that treating emacs as a common lisp compiler will bring along a whole world of unwanted nuisance
<jgkamat>
use cl-lib not cl, cl is deprecated due to namespace conflicts
<mrblack>
thanks, adlai
<djeis[m]>
Elisp is definitely easier to learn knowing CL, but they're still rather different languages.