jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | offtopic --> #lispcafe
cosimone_ has joined #lisp
cosimone has quit [Ping timeout: 240 seconds]
cosimone_ is now known as cosimone
jibanes has quit [Ping timeout: 240 seconds]
EvW has quit [Ping timeout: 268 seconds]
asdfffgg has joined #lisp
jibanes has joined #lisp
karlosz has quit [Quit: karlosz]
asdfffgg has quit [Remote host closed the connection]
FennecCode has quit [Ping timeout: 258 seconds]
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #lisp
hendursaga has quit [Remote host closed the connection]
bilegeek has joined #lisp
hendursaga has joined #lisp
EvW has joined #lisp
FennecCode has joined #lisp
cantstanya has quit [Remote host closed the connection]
nij has quit [Ping timeout: 260 seconds]
cantstanya has joined #lisp
bilegeek has quit [Quit: Leaving]
bilegeek has joined #lisp
akoana has joined #lisp
dbotton has quit [Quit: This computer has gone to sleep]
kevingal has joined #lisp
kevingal has quit [Remote host closed the connection]
defunkydrummer has quit [Ping timeout: 256 seconds]
surabax has quit [Quit: Leaving]
miasuji has quit [Ping timeout: 260 seconds]
cantstanya has quit [Remote host closed the connection]
karlosz has joined #lisp
cantstanya has joined #lisp
wxie has joined #lisp
Oladon has joined #lisp
jibanes has quit [Ping timeout: 268 seconds]
jibanes has joined #lisp
iarebatman has joined #lisp
<iarebatman> Hey all.
nij has joined #lisp
<iarebatman> Is anyone aware of any lisp-related job openings?
<nij> Is it possible to extend the definition of an existing function? For example, '+ is defined for numbers. Can I *extend* its definition for strings, so that (+ "a" "b") => "ab" with (+ 1 2) => 3.
<nij> ?
jello_pudding has quit [Ping timeout: 264 seconds]
jibanes has quit [Ping timeout: 256 seconds]
<Oladon> iarebatman: Usually Planet Lisp is a good resource for those.
jibanes has joined #lisp
EvW has quit [*.net *.split]
bilegeek has quit [*.net *.split]
hnOsmium0001 has quit [*.net *.split]
bitmapper has quit [*.net *.split]
amerigo has quit [*.net *.split]
beach has quit [*.net *.split]
oni-on-ion has quit [*.net *.split]
CEnnis91 has quit [*.net *.split]
physpi has quit [*.net *.split]
krjst has quit [*.net *.split]
otwieracz has quit [*.net *.split]
mpontillo has quit [*.net *.split]
avicenna has quit [*.net *.split]
dnm has quit [*.net *.split]
shinohai has quit [*.net *.split]
jasom has quit [*.net *.split]
phoe has quit [*.net *.split]
shrysr has quit [*.net *.split]
bonz060 has quit [*.net *.split]
markasoftware has quit [*.net *.split]
xristos has quit [*.net *.split]
felideon has quit [*.net *.split]
kim\ has quit [*.net *.split]
Jesin has quit [Ping timeout: 246 seconds]
<edgar-rft> nij: it's not allowed to redifine cl:+ (package lock error) but it's possible to either "shadow" the + symbol by some package-trickery or easier, define a "my-+" function (or some better name) that implements the string-behaviour and calls cl:+ for non-string arguments.
<mrcom> nij: No, maybe, and sort-of.
<mrcom> (what edgar-rft said)
bilegeek has joined #lisp
EvW has joined #lisp
beach has joined #lisp
mpontillo has joined #lisp
physpi has joined #lisp
CEnnis91 has joined #lisp
krjst has joined #lisp
amerigo has joined #lisp
bitmapper has joined #lisp
hnOsmium0001 has joined #lisp
otwieracz has joined #lisp
oni-on-ion has joined #lisp
avicenna has joined #lisp
dnm has joined #lisp
jasom has joined #lisp
felideon has joined #lisp
shinohai has joined #lisp
phoe has joined #lisp
markasoftware has joined #lisp
xristos has joined #lisp
kim\ has joined #lisp
bonz060 has joined #lisp
shrysr has joined #lisp
<moon-child> you probably want my-+ to be a generic
<Oladon> nij: Yes, and no. You can very easily write a new method which uses type dispatch to handle various types of arguments... heh, edgar-rft mostly covered it :)
<iarebatman> Oladon: I'll check it out, thank you
<Oladon> iarebatman: Sure thing. Good luck!
<moon-child> (defgeneric m+ (a b)) (defmethod m+ ((a string) (b string)) (concatenate 'string a b)) (defmethod m+ ((a fixnum) (b fixnum)) (+ a b))
<mrcom> minion: clhs 11.1.2.1.2
<minion> you speak nonsense
jibanes has quit [Ping timeout: 256 seconds]
<edgar-rft> clhs 11.1.2.1.2
<specbot> Constraints on the COMMON-LISP Package for Conforming Programs: http://www.lispworks.com/reference/HyperSpec/Body/11_abab.htm
<Bike> some standard functions are generic, so they can be extended. like initialize-instance. arithmetic functions are not generic functions, though.
jibanes has joined #lisp
amerigo has quit [Ping timeout: 260 seconds]
hnOsmium0001 has quit [Ping timeout: 260 seconds]
amerigo has joined #lisp
hnOsmium0001 has joined #lisp
defunkydrummer has joined #lisp
jibanes has quit [Ping timeout: 246 seconds]
rumbler31_ has quit [Read error: Connection reset by peer]
<phadthai> nij: example of shadowing: (defpackage "mycl" (:shadow #:+) (:use cl)) (in-package "mycl") (defun + (a b) (- a b)) (+ 2 1) -> 1
jibanes has joined #lisp
Lord_of_Life_ has joined #lisp
<phadthai> err :use :cl
Lord_of_Life has quit [Ping timeout: 240 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<phadthai> in this case not only does it break + by actually using -, it also only accepts two arguments unlike CL +
wooden has quit [Ping timeout: 240 seconds]
<phadthai> but cl:+ is always usable from within mycl too
defunkydrummer has quit [Quit: Leaving]
kaftejiman has quit [Remote host closed the connection]
stux|RC-only has quit [Read error: Connection reset by peer]
gabiruh has quit [Quit: ZNC 1.7.5 - https://znc.in]
Blukunfando has joined #lisp
gabiruh has joined #lisp
stux|RC-only has joined #lisp
<aeth> Once when I had to use a custom +, I didn't actually directly override CL:+... I had a macrolet (iirc, might've been something similar) local to a given function that selected which + it was using. It made it really easy to debug.
jibanes has quit [Ping timeout: 246 seconds]
entre-parenteses has quit [Quit: ERC (IRC client for Emacs 27.1)]
wxie has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
<phadthai> yes that should work where there's no need to treat the operator as a function
wxie has joined #lisp
bilegeek_ has joined #lisp
bilegeek has quit [Ping timeout: 260 seconds]
amerigo has quit [Quit: Connection closed for inactivity]
charlie770 has joined #lisp
charlie770 has quit [Ping timeout: 256 seconds]
<aeth> it might have been an FLET
<aeth> declaring it inline will allow you to treat it like a function for higher order functions, while also optimizing the inefficient &rest away
wxie has quit [Ping timeout: 265 seconds]
charlie770 has joined #lisp
charlie770 has quit [Client Quit]
renzhi has joined #lisp
<mister_m> Hi I am reading steve Losh's chip-8 tutorial and there is a macro they define that allows users to more easily define instructions outlined in this section: https://stevelosh.com/blog/2016/12/chip8-cpu/#s18-define-instruction, however it seems to be leaky in that it exposes a macro internal thru the macrolet definition of `register'
<mister_m> I'm wondering if there's a way to employ that local register macro without it being "leaked"
<no-defun-allowed> I think that leaking is intentional.
<no-defun-allowed> Oh, for (register <n>)?
<mister_m> that's right, yes
<no-defun-allowed> WITH-CHIP appears to also leak and bind REGISTERS without the user specifying it.
<mister_m> yep, I'd say that is correct as well
<no-defun-allowed> You could GENSYM a variable in place of REGISTERS, and have WITH-CHIP and REGISTERS use that.
<aeth> or alexandria:with-gensyms
<no-defun-allowed> Which does exactly that.
Oladon has quit [Quit: Leaving.]
<aeth> right, same thing, just less manual
miasuji has joined #lisp
<aeth> e.g. (alexandria:with-gensyms (register) `(,register)) => (#:REGISTER629) ; your number may vary
cosimone has quit [Quit: cosimone]
<mister_m> that does seem at least a bit better than having it just be exposed - would it be maybe also slightly better stylistically to modify the define-instruction macro lambda list to allow the user to explicitly provide the name they want to use?
<aeth> yes
<aeth> you can even do both
<mister_m> definitely
<mister_m> thanks for the suggestions
<aeth> i.e. default value to gensym (or just wait until it's NIL and then GENSYM if you want to avoid creating a GENSYM that might not be used)
<nij> edgar-rft, mrcom, moon-child, phadthai, and aeth thanks for your response. I was working and didn't see it until now.
thmprover has joined #lisp
<nij> Hmm.. I didn't know of shadow, and it does seem advanced. However, I really hope to redefine CL:+. Isn't there some dirty way to force the redefinition?
wxie has joined #lisp
<Bike> not standardly.
<Alfr> nij, compilers may simply ignore your redefinition of cl:+ or may honor it, depending on the phase of the moon.
<no-defun-allowed> For "prior art", in Netfarm I write (define-instruction <opcode> <name> ((:some-register variable-name ...) stack-arguments ...) (opcode-arguments ...) ...)
<Bike> any such way would hit serious problems with built in and other earlier defined functions that use addition, and also compilers often handle arithmetic functions somewhat magically
<no-defun-allowed> For example, <https://gitlab.com/cal-coop/netfarm/netfarm/-/blob/master/Code/Scripts/Script-machine/operators.lisp#L97> uses all those; and I can compile all the bodies into one big dispatch loop with lexical variables for registers, as I never touch a structure directly.
<Bike> for example sbcl has a "source transform" on + that will try to merge constants together, among other things
jibanes has quit [Ping timeout: 256 seconds]
<Bike> compilers may not put in an "actual" call to +, meaning that code that has (+ ...) forms won't actually be affected by your redefinition
<Bike> thus resulting in weird inconsistencies
<phadthai> yes and any compiled code using optimization declarations might end up generating inline direct math operations on variables or registers internally (in C for ECL, in ASM for SBCL, etc)
skapata has quit [Ping timeout: 260 seconds]
<nij> I see. Given all this.. I will just use m+.
EvW has quit [Ping timeout: 260 seconds]
<nij> Which is a little bad as I like pure symbols.
<Bike> designing an interface that's both flexibly responsive to redefinitions, but also can be compiled efficiently, is rather difficult
jibanes has joined #lisp
<nij> That also means if I'm defining more abstract mathematical objects, I am required to use m+ too..
lotuseater has quit [Ping timeout: 272 seconds]
<nij> e.g. on rational numbers, groups, fields.. etc.
<Alfr> nij, shadow + or don't use c-l in your package.
<nij> Or perhaps I should use unicode + to alias some other my-add.
<nij> s/some other//
<no-defun-allowed> SBCL normalises + to +, sadly.
<no-defun-allowed> Or maybe fortunately, because that's evil.
<aeth> looks different to me
<no-defun-allowed> Try (+ 2 2)
<aeth> definitely looks different
<phadthai> shadowing allows you to have your custom ops package that can be "use"d by other packages resulting in what you want, but you'd have to make sure in those to always use explicit cl:+ when needing CL's
euandreh has quit [Remote host closed the connection]
<aeth> extra space
<nij> 🞥
<aeth> Anyway... cl:+ is probably one of the most optimized parts of a compiler, and even SBCL's + doesn't optimize nearly as much as it could based on some optimizations in e.g. Java or C
<phadthai> I've seen some examples using words for operators also, another option
<nij> aeth: lol
<no-defun-allowed> (PLUS '2 '2) would be the old fashioned way.
<aeth> if you let redefinition happen, you remove some optimizations
<nij> I almost give up.. perhaps the right way to implement a CAS is really to use usual notation: "1+1" instead of (+ 1 1).
<nij> And therefore I need a DSL. But this has been done already.
<nij> I was hoping to do that in lisp.
<nij> TT
<no-defun-allowed> Yes and no, your input syntax may not be Lisp, but you can still continue to use Lisp structures.
<no-defun-allowed> The example on https://www.irif.fr/~jch/software/cl-yacc/cl-yacc.html does exactly that, parsing an infix string to Lisp.
Jesin has joined #lisp
<Alfr> nij, I don't see why you want to redefine cl:+. Or what is wrong with your-cas:+ ?
<Alfr> nij, every package using that your-cas package would be able to access that your-cas:+ simply using + .
<no-defun-allowed> I mean, your user probably wants to write something like "a * b + a * c = a * (b + c)".
<nij> no-defun-allowed: not sure if I will be the only user ;)
<nij> If I am, I'm happy to write in lisp.
<no-defun-allowed> And that would define a rewrite rule for (+ (* ?a ?b) (* ?a ?c)) <=> (* ?a (+ ?b ?c)), supposing that is the representation you want.
<nij> I'm not sure if I want to refine that rewrite rule..
<nij> say a and b are rational numbers c/d and e/f
<nij> (+ a b) will evaluate to (cf+de)/df directly
jibanes has quit [Ping timeout: 240 seconds]
<nij> I will look at CL-Yacc tomorrow. Seems legit. My brain has been drained.
skapata has joined #lisp
<no-defun-allowed> You have to decide which rules, if any, would give you the ideal representation for the human reader.
<no-defun-allowed> I recall Sussman also had a paper on that, but I forgot it.
<nij> Lisp's is of course better..
<nij> when you have a*b*c*d*e + f*e*f*g*s*dl*sa*qw*dsf*d + ...
<nij> It's much clearner to see (+ (* a b c d e) \n ..
jibanes has joined #lisp
<nij> The parentheses help a lot for us to focus.
<nij> you can write (a*b*c*d*e) too, but you have to spend time checking if all operators are *
<no-defun-allowed> Here you are, "Algebraic simplification: A guide for the complexed" https://groups.csail.mit.edu/mac/users/gjs/6.945/readings/simplification/moses-simp.pdf
<Alfr> nij, also if you want to recycle cl:+ for cl's numbers, you could make your + a generic function which then dispatches for arguments of class number to cl:+ .
Jeanne-Kamikaze has joined #lisp
<no-defun-allowed> That wasn't Sussman, but there's GJS in the URL so I wasn't entirely wrong.
rwcom60280385034 has joined #lisp
<nij> So can I stay in cl, but only disable cl:+?
<nij> and then implement my:+, which is called by +?
<thmprover> nij, you might want to look up Fateman's paper "Building a CAS by overloading Lisp" (or something like that), he talks about shadowing cl:+
<thmprover> There's code too, on Fateman's website, for the generic arithmetic hack.
<Alfr> nij, sure. That's what packages are good for. :)
<phadthai> in case this could help to better understand packages and symbols (I don't recommend to use it for the security of "safe" as it's just a test/demo): http://git.pulsar-zone.net/?p=mmondor.git;a=blob;f=mmsoftware/cl/test/safe-eval.lisp;hb=HEAD
<phadthai> this mimics CL/CL-USER
<nij> Oh folks.... thank you so much T_T
<nij> I almost cried.
<nij> Will take a look tomorrow.
<thmprover> Fateman's code is a bit buggy
* nij 's brain is shutting off.
<thmprover> I patched it up, but never uploaded it anywhere, lemme know if you're curious
<nij> Alfr: by how? Is that what shadowing does?
aartaka has joined #lisp
Alfr_ has joined #lisp
<beach> Good morning everyone!
<thmprover> nij: you might want to read "Building Problem Solvers", one of the early chapters implements a pattern-matching algorithm, which can be used for simplifying algebraic expressions.
<thmprover> Good morning, beach!
<Alfr_> nij, you'll likely use defpackage's :shadow to make yours. http://www.lispworks.com/documentation/HyperSpec/Body/m_defpkg.htm
<Alfr_> Hi beach.
Alfr has quit [Ping timeout: 268 seconds]
<Alfr_> nij, there's also shadow if you want to make one later: http://www.lispworks.com/documentation/HyperSpec/Body/f_shadow.htm
Oladon has joined #lisp
orivej_ has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
ex_nihilo has joined #lisp
Stanley00 has joined #lisp
jibanes has quit [Ping timeout: 265 seconds]
rwcom60280385034 has quit [Quit: Ping timeout (120 seconds)]
rwcom60280385034 has joined #lisp
jibanes has joined #lisp
AndroUser has joined #lisp
AndroUser has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
Bike has quit [Quit: Lost terminal]
miasuji has quit [Ping timeout: 260 seconds]
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #lisp
MrFantastik is now known as cactus
g0d_shatter has joined #lisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #lisp
bilegeek_ has quit [Quit: Leaving]
pagnol has joined #lisp
jibanes has quit [Ping timeout: 256 seconds]
kam1 has joined #lisp
jibanes has joined #lisp
narimiran has joined #lisp
madage has quit [Quit: leaving]
orivej_ has quit [Ping timeout: 256 seconds]
kam1 has quit [Read error: Connection reset by peer]
wxie has quit [Ping timeout: 260 seconds]
renzhi has quit [Ping timeout: 272 seconds]
saganman has joined #lisp
mbomba has joined #lisp
madage has joined #lisp
jibanes has quit [Ping timeout: 260 seconds]
terpri has quit [Remote host closed the connection]
jibanes has joined #lisp
kam1 has joined #lisp
terpri has joined #lisp
akoana has left #lisp ["Leaving"]
kam1 has quit [Read error: Connection reset by peer]
jibanes has quit [Ping timeout: 268 seconds]
wxie has joined #lisp
jibanes has joined #lisp
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
dbotton has joined #lisp
Oladon has quit [Quit: Leaving.]
pyx has joined #lisp
pyx has quit [Client Quit]
waleee-cl has quit [Quit: Connection closed for inactivity]
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
rwcom60280385034 has quit [Quit: Ping timeout (120 seconds)]
thmprover has quit [Quit: Another long day's journey into night.]
rwcom60280385034 has joined #lisp
dbotton has quit [Quit: This computer has gone to sleep]
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #lisp
Jeanne-Kamikaze has quit [Ping timeout: 256 seconds]
jibanes has quit [Ping timeout: 264 seconds]
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
jibanes has joined #lisp
entre-parenteses has joined #lisp
fixing_auth_hold has joined #lisp
skapata has quit [Remote host closed the connection]
fixing_auth_hold has quit [Client Quit]
ldbeth has joined #lisp
lalilulelo has quit [Ping timeout: 260 seconds]
pagnol has quit [Ping timeout: 265 seconds]
<ldbeth> good afternoon
aindilis has quit [Ping timeout: 256 seconds]
<no-defun-allowed> Hello ldbeth.
<edgar-rft> "after" is what a german doctor calls your anus :-)
ldbeth has quit [Read error: Connection reset by peer]
<fe[nl]ix> edgar-rft: that wasn't funny
ldbeth has joined #lisp
<no-defun-allowed> I didn't know I wanted to hear that, and I still don't know if I wanted to hear that.
bilegeek has joined #lisp
jibanes has quit [Ping timeout: 268 seconds]
jibanes has joined #lisp
pagnol has joined #lisp
kam1 has joined #lisp
jibanes has quit [Ping timeout: 268 seconds]
jibanes has joined #lisp
frost-lab has joined #lisp
fanta1 has joined #lisp
ex_nihilo has quit [Ping timeout: 260 seconds]
quazimodo has joined #lisp
andreyorst has joined #lisp
andreyorst` has joined #lisp
treflip has joined #lisp
andreyorst has quit [Ping timeout: 240 seconds]
bilegeek has quit [Quit: Leaving]
ldbeth has quit [Ping timeout: 246 seconds]
cantstanya has quit [Ping timeout: 240 seconds]
hendursaga has quit [Ping timeout: 240 seconds]
madage has quit [Ping timeout: 240 seconds]
gxt has quit [Ping timeout: 240 seconds]
madage has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
gxt has joined #lisp
hendursaga has joined #lisp
cantstanya has joined #lisp
g0d_shatter has quit [Quit: Leaving]
andreyorst has joined #lisp
jibanes has quit [Ping timeout: 264 seconds]
lotuseater has joined #lisp
susam has joined #lisp
jibanes has joined #lisp
madage has quit [Ping timeout: 240 seconds]
cantstanya has quit [Ping timeout: 240 seconds]
andreyorst has quit [Ping timeout: 260 seconds]
madage has joined #lisp
pagnol has quit [Ping timeout: 240 seconds]
cantstanya has joined #lisp
pankajsg has quit [Ping timeout: 256 seconds]
zacts has joined #lisp
entre-parenteses has quit [Ping timeout: 260 seconds]
random-nick has joined #lisp
<zacts> hello
<beach> Hello zacts.
jibanes has quit [Ping timeout: 256 seconds]
<zacts> I'm working thru this practical common lisp
jibanes has joined #lisp
<beach> Good.
jibanes has quit [Ping timeout: 246 seconds]
jibanes has joined #lisp
rogersm has joined #lisp
aartaka_d has joined #lisp
aartaka has quit [Ping timeout: 240 seconds]
pankajsg has joined #lisp
flip214 has quit [Ping timeout: 268 seconds]
shka_ has joined #lisp
pve has joined #lisp
pankajsg has quit [Ping timeout: 272 seconds]
atomik has joined #lisp
jibanes has quit [Ping timeout: 260 seconds]
atomik_dog has quit [Ping timeout: 268 seconds]
galex-713_ has quit [Ping timeout: 272 seconds]
galex-713 has joined #lisp
jibanes has joined #lisp
heisig has joined #lisp
rgherdt has joined #lisp
jibanes has quit [Ping timeout: 256 seconds]
villanella has joined #lisp
jibanes has joined #lisp
nostoi has joined #lisp
jprajzne has joined #lisp
zacts has quit [Quit: leaving]
pankajsg has joined #lisp
flip214 has joined #lisp
liberliver has joined #lisp
Ekho has quit [Quit: CORE ERROR, SYSTEM HALTED.]
hendursa1 has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
Ekho has joined #lisp
villanella has quit [Ping timeout: 268 seconds]
Cymew has joined #lisp
<edgar-rft> fe[nl]ix: that's a fact, it wasn't intended to be funny
orivej has joined #lisp
amerigo has joined #lisp
gigetoo has quit [Ping timeout: 240 seconds]
gigetoo has joined #lisp
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
galex-713 has quit [Ping timeout: 264 seconds]
mbomba has quit [Quit: WeeChat 3.0]
Alfr_ has quit [Remote host closed the connection]
Alfr_ has joined #lisp
galex-713 has joined #lisp
scymtym has quit [Ping timeout: 240 seconds]
Alfr_ has quit [Remote host closed the connection]
Alfr_ has joined #lisp
Alfr_ has quit [Remote host closed the connection]
zacts has joined #lisp
scymtym has joined #lisp
wxie has quit [Ping timeout: 268 seconds]
treflip has quit [Quit: WeeChat 2.6]
Alfr has joined #lisp
waleee-cl has joined #lisp
kevingal has joined #lisp
kevingal has quit [Quit: Leaving]
kevingal has joined #lisp
imode has quit [Quit: Batsharks are people too!]
gxt has quit [Ping timeout: 240 seconds]
ldbeth has joined #lisp
surabax has joined #lisp
jibanes has quit [Ping timeout: 264 seconds]
ljavorsk has joined #lisp
ldbeth` has joined #lisp
jibanes has joined #lisp
ldbeth has quit [Ping timeout: 240 seconds]
zacts has quit [Quit: leaving]
dhil has joined #lisp
ldbeth` has quit [Ping timeout: 260 seconds]
skapata has joined #lisp
matryoshka has quit [Ping timeout: 268 seconds]
ljavorsk has quit [Ping timeout: 268 seconds]
lotuseater has quit [Remote host closed the connection]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 246 seconds]
X-Scale` is now known as X-Scale
lotuseater has joined #lisp
ldbeth` has joined #lisp
ldbeth` has quit [Ping timeout: 256 seconds]
vegansbane6 has quit [Quit: The Lounge - https://thelounge.chat]
ldbeth` has joined #lisp
Stanley00 has quit [Remote host closed the connection]
eden has joined #lisp
nostoi has quit [Quit: Verlassend]
ldbeth` has quit [Ping timeout: 246 seconds]
kenran has joined #lisp
oxum_ has joined #lisp
oxum has quit [Ping timeout: 265 seconds]
oxum has joined #lisp
oxum_ has quit [Ping timeout: 246 seconds]
<kenran> What should I be searching for when I wish to do something like: 1) acquire a resource 2) do something with it, but when this fails 3) release the resource? I'm thinking of something like Haskell's bracket or may try/catch/finally in some other languages.
<jackdaniel> kenran: unwind-protect
<jackdaniel> if you want to release it after the block, regardless of whether there was a an error or not
<jackdaniel> i.e (let ((foo (acquire))) (unwind-protect (my-function foo) (release foo)))
ldbeth` has joined #lisp
villanella has joined #lisp
<kenran> jackdaniel: thanks, exactly what I was looking for!
<jackdaniel> if you want to perform some operation /only when an error happens/ you should use handler-case or handler-bind with the clause serious-condition
<jackdaniel> s/when an error/when something serious happens/
<jackdaniel> i.e a timeout is not an error (at least in most implementations), neither is the storage-condition
<jackdaniel> but both are serious-condition 's
ldbeth` has quit [Ping timeout: 256 seconds]
<kenran> cool, good to know!
vegansbane6 has joined #lisp
Cthulhux has quit [Changing host]
Cthulhux has joined #lisp
kaftejiman has joined #lisp
ldbeth` has joined #lisp
ldbeth` has quit [Ping timeout: 240 seconds]
ldbeth` has joined #lisp
FreeBirdLjj has joined #lisp
Nilby has joined #lisp
ldbeth` has quit [Ping timeout: 268 seconds]
nij has quit [Remote host closed the connection]
nij has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
nij has quit [Client Quit]
ldbeth` has joined #lisp
flazh has quit [Ping timeout: 272 seconds]
ldbeth` has quit [Ping timeout: 264 seconds]
treflip has joined #lisp
ldbeth` has joined #lisp
ldbeth` has quit [Ping timeout: 260 seconds]
heisig has quit [Quit: Leaving]
ldbeth` has joined #lisp
treflip has quit [Quit: WeeChat 2.6]
ldbeth` has quit [Ping timeout: 265 seconds]
amerigo has quit [Quit: Connection closed for inactivity]
ldbeth` has joined #lisp
ldbeth` has quit [Ping timeout: 264 seconds]
dddddd has quit [Quit: dddddd]
dddddd has joined #lisp
EvW has joined #lisp
ldbeth` has joined #lisp
frost-lab has quit [Quit: Connection closed]
ldbeth` has quit [Ping timeout: 268 seconds]
ldbeth` has joined #lisp
gaqwas has quit [Remote host closed the connection]
ex_nihilo has joined #lisp
ldbeth` has quit [Client Quit]
aartaka_d has quit [Read error: Connection reset by peer]
aartaka has joined #lisp
Bike has joined #lisp
dbotton has joined #lisp
dbotton has quit [Client Quit]
galex-713 has quit [Ping timeout: 272 seconds]
fanta1 has quit [Quit: fanta1]
fanta1 has joined #lisp
EvW has quit [Ping timeout: 268 seconds]
pfdietz has joined #lisp
EvW has joined #lisp
Stanley00 has joined #lisp
ggole has joined #lisp
Stanley00 has quit [Ping timeout: 264 seconds]
gaqwas has joined #lisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #lisp
wsinatra has joined #lisp
villanella has quit [Quit: villanella]
eden has quit [Ping timeout: 240 seconds]
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #lisp
eden has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
jibanes has quit [Ping timeout: 268 seconds]
jibanes has joined #lisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #lisp
Colleen has quit [Remote host closed the connection]
Colleen has joined #lisp
EvW has quit [Ping timeout: 264 seconds]
jibanes has quit [Ping timeout: 256 seconds]
cosimone has joined #lisp
jibanes has joined #lisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #lisp
luckless has joined #lisp
matryoshka has joined #lisp
Nilby has quit [Read error: Connection reset by peer]
jibanes has quit [Ping timeout: 240 seconds]
notzmv` has joined #lisp
<kenran> I've been trying to use SLY (it came with doom emacs' common-lisp module, but I'm open to switching to SLIME if that's easier) to load a nearly-empty ASDF project. For that, I added the package sly-asdf and tried doing sly-compile-and-load-file. It complains about COMMON-LISP-USER::DEFSYSTEM being an undefined function. I've enabled the sly-asdf contrib. What else should I look into?
notzmv has quit [Read error: Connection reset by peer]
<kenran> Ahhh nevermind, I found it: quickproject created an .asd file that called (defsystem) and not (asdf:defsystem ...). Qualifying the call made sly-compile-and-load-system work again.
lansiir has joined #lisp
oldtopman has quit [Ping timeout: 264 seconds]
jibanes has joined #lisp
ex_nihilo has quit [Quit: Leaving]
entre-parenteses has joined #lisp
<Bike> i don't think you're supposed to compile and load ASD files like they're lisp files, which it sounds like you're doing
sjl has joined #lisp
jurov_ has joined #lisp
<pfdietz> I'm assuming asdf loads them with *package* bound to the asdf package.
<jackdaniel> asdf loads asd files anyway
* jackdaniel usually puts (in-package #:asdf-user) at the top of the asd file, although it is not encouraged by the asdf manual
jurov has quit [Ping timeout: 240 seconds]
<jackdaniel> you still need to define and put in-package if you extend the asdf (i.e to define new file types)
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
<pfdietz> Ah: asdf loads asd files in a temporary package that :uses the asdf package (and cl).
Steeve has joined #lisp
aartaka_d has joined #lisp
Jesin has quit [Ping timeout: 256 seconds]
cosimone has quit [Quit: cosimone]
iskander has joined #lisp
aartaka has quit [Ping timeout: 268 seconds]
cosimone has joined #lisp
aartaka has joined #lisp
iskander- has quit [Ping timeout: 256 seconds]
flazh has joined #lisp
kaftejiman has quit [Remote host closed the connection]
aartaka_d has quit [Ping timeout: 240 seconds]
defunkydrummer has joined #lisp
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #lisp
Stanley00 has joined #lisp
andreyorst` has quit [Quit: andreyorst`]
andreyorst has joined #lisp
Fare has joined #lisp
Stanley00 has quit [Ping timeout: 272 seconds]
jibanes has quit [Ping timeout: 264 seconds]
cosimone_ has joined #lisp
iskander has quit [Ping timeout: 268 seconds]
makomo has joined #lisp
jibanes has joined #lisp
<makomo> hello \o
cosimone has quit [Read error: Connection reset by peer]
cosimone_ is now known as cosimone
orivej has joined #lisp
andreyorst has quit [Ping timeout: 256 seconds]
eden has quit [Remote host closed the connection]
phireh has joined #lisp
eden has joined #lisp
andreyorst has joined #lisp
eden has quit [Remote host closed the connection]
eden has joined #lisp
dmiles has quit [Ping timeout: 260 seconds]
dmiles has joined #lisp
wsinatra has quit [Ping timeout: 272 seconds]
wsinatra has joined #lisp
natter has joined #lisp
eden has quit [Quit: Leaving]
jibanes has quit [Ping timeout: 265 seconds]
jibanes has joined #lisp
<beach> Hello makomo.
<lotuseater> hi makomo
galex-713 has joined #lisp
<makomo> hi beach :)
<makomo> hi lotuseater :D
Oladon has joined #lisp
iskander has joined #lisp
<beach> makomo: Where have you been hiding all this time?
<beach> Actually, you haven't been here much at all this year.
<makomo> very good question :')
<beach> No need to answer if it's too personal.
<makomo> hehe, that's not it, don't worry. but thanks :)
<makomo> but i'm not too sure myself LOL. i guess i was finishing up my msc and now i've successfully graduated not too long ago :). also, sometimes i just forget to start my irc client and then quickly forget irc even exists o_O
<makomo> i gotta start being more regular again for sure :D
<beach> Congratulations to graduating.
<makomo> thank you :D
<beach> Maybe now you have a lot of free time that we can take advantage of? :)
<makomo> HAHA, i like that thinking :) :). i've actually started a phd now as well, but that doesn't necessarily imply i won't have time ;)
<beach> Wow, nice! What's the subject?
kam1 has quit [Read error: Connection reset by peer]
<makomo> it has to do with languages for concurrent and distributed systems :)
<beach> Sounds hard. :)
<lotuseater> sounds like Erlang/LFE incoming :P
cosimone has quit [Remote host closed the connection]
<makomo> heh, i thought so as well. but i also thought it would be a great opportunity, so welp, gotta stuck it up and bang my head i suppose ;)
Steeve has quit [Quit: end]
EvW has joined #lisp
eden has joined #lisp
eden has quit [Remote host closed the connection]
kam1 has joined #lisp
Cymew has quit [Ping timeout: 268 seconds]
kam1 has quit [Read error: Connection reset by peer]
tfb has joined #lisp
andreyorst has quit [Ping timeout: 260 seconds]
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #lisp
<kenran> So far I've seen `:depends-on (:cffi)`, `:depends-on ("cffi")` and `(:depends-on (#:cffi)`. Are there any semantic differences between these in a defsystem form?
liberliver has quit [Ping timeout: 260 seconds]
<dim> yes and no, I suppose a “package designator” is not very well defined, and accepts either a string or a symbol for sure
<dim> :cffi is a symbol that is going to be interned I can't remember in which package, #:cffi forces the symbol to be interned in the KEYWORDS package if I remember correctly, and of course "cffi" is using a string as a package system designator here
<dim> so I said “package designator” before when I meant “system designator” I suppose
surabax_ has joined #lisp
<kenran> dim: thanks! If I have no real idea what difference it makes where stuff gets interned, which of the three variants should I use as a newbie? Or is the essence "it doesn't really matter at all"?
<dim> it kind of matters that you understand what is a string and what is a symbol, and why symbol exist in a package, and what is a package
<dim> http://www.gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html might be a good way to wrap your head around those notions
surabax has quit [Ping timeout: 268 seconds]
<dim> http://www.flownet.com/ron/packages.pdf this also helped me when a beginner myself (I suppose I have reached “intermediate” level)
<kenran> vim: thanks again
<kenran> dim: *lol
<kenran> freudian typo
surabax_ is now known as surabax
<lotuseater> kenran: there is also a part about this in common lisp recipes
<dim> I liked https://web.archive.org/web/20171127051637/http://weitz.de:80/packages.html which is hard to find nowadays, and some people here advice not reading it IIRC, but I did find it helpful at the time
<aeth> dim: you have it backwards... :cffi is in keywords
<aeth> (symbol-package :cffi) => #<PACKAGE "KEYWORD">
<dim> ah thanks for fixing it!
<aeth> (symbol-package '#:cffi) => NIL
<dim> what about #:cffi then?
<dim> forces to avoid any interning?
<aeth> (it has to be quoted because symbol-package isn't a macro... when it's used unquoted, it's in a macro)
<aeth> right
<aeth> I prefer to use #:foo or, if I need to get its name, (symbol-name '#:foo)
<lotuseater> dim: the allusion at beginning is funny
<aeth> (symbol-name '#:foo) is perfectly free of side effects so any decent compiler should turn that into "FOO". Or maybe "foo" if it's in "modern mode"
<dim> okay that makes sense, I knew there was something about interning, and something about the KEYWORD package, and then I failed to remember the details correctly, shows that I have spent two years writing C code and less and less CL code, sorry about that
<aeth> dim: Well, I knew the answer but I verified it in the REPL before posting. That's the good thing about CL... if you know the functions (in this case SYMBOL-PACKAGE) then it's easy to verify
<aeth> Whereas in C, you have to think of a trivial test program and hope that it always is true...
<aeth> (C has a few interpreters for REPL, but there's no guarantee that those interpreters are written correctly since nobody uses them.)
gxt has joined #lisp
<dim> yeah I did write a full command line parsing utility so that I could export my C internal routines at the top-level easily and then test them and play with the code in isolation, without having to create a full test environment, so yeah... lots of bonus points for CL to make that just the default
lucasb has joined #lisp
Jesin has joined #lisp
<aeth> eh, it's not that hard
<aeth> Most things can just be tested inside of a hello world style main
<aeth> Or at the top level called from that main
<aeth> It's just 10x more effort than entering a one-liner into a REPL
hugh_marera has quit [Quit: Connection closed]
<dim> yeah, not hard, but requires a special effort nonetheless, and then you have to do it again and again
pankajsg has quit [Ping timeout: 265 seconds]
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
defunkydrummer has quit [Quit: Leaving]
saganman has quit [Ping timeout: 268 seconds]
jibanes has quit [Ping timeout: 268 seconds]
Oladon has quit [Quit: Leaving.]
amb007 has quit [Ping timeout: 268 seconds]
jibanes has joined #lisp
amb007 has joined #lisp
Stanley00 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
Stanley00 has quit [Ping timeout: 240 seconds]
jibanes has quit [Ping timeout: 268 seconds]
jibanes has joined #lisp
dbotton has joined #lisp
<phantomics> Is anyone using lparallel much? Have some questions about threaded array operations
hugh_marera has joined #lisp
makomo has quit [Ping timeout: 246 seconds]
rogersm has quit [Quit: Leaving...]
aindilis has joined #lisp
fdddd has joined #lisp
kaftejiman has joined #lisp
<shka_> how can i add shortcut in emacs to launch Clouseau like a slime inspector?
pankajsg has joined #lisp
Stanley00 has joined #lisp
<Gnuxie[m]> I'd like to know too
andreyorst has joined #lisp
Stanley00 has quit [Ping timeout: 256 seconds]
mbomba has joined #lisp
makomo has joined #lisp
<fdddd> What is a simple way to use asdf for an application with several sub-packages? Can I use a single defsystem declaration for this? If you know of some good examples I would love to see them.
<shka_> fdddd: yes
liberliver has joined #lisp
<shka_> single asd file if fine
Blukunfando has quit [Ping timeout: 240 seconds]
<shka_> package is just bag of symbols
<shka_> nothing to do with actual build
<fdddd> I was looking at this file for example: https://github.com/borodust/cl-bodge/blob/master/cl-bodge.asd Seems rather complicated. Could it be defined with a single defsystem for instance?
<shka_> here
Jesin has quit [Quit: Leaving]
<shka_> i put packages in separate modules, only because i like it this way
Jesin has joined #lisp
<fdddd> Makes sense. I like this approach. Thanks
<shka_> you are welcome
liberliver has quit [Quit: liberliver]
jprajzne has quit [Quit: Leaving.]
zacts has joined #lisp
zacts has quit [Client Quit]
liberliver has joined #lisp
v3ga has quit [Ping timeout: 258 seconds]
<kenran> I've asked earlier on how to do something like Haskell's bracket to acquire, use and release resource (a function taking 3 functions, basically) and was shown unwind-protect. One example where I'd use this would be something like an SDL2 texture. Is this also the lispy way of doing things, or would an OO approach would work better here? I haven't actually read up on CLOS yet, but I figure something like a
<kenran> destructor or finalizer is surely possible. What's the go-go style?
phireh has quit [Ping timeout: 260 seconds]
<shka_> kenran: typically, lispers write macros like those http://clhs.lisp.se/Body/m_w_open.htm
<shka_> postmodern has with-connection for instance
<shka_> but they are found just about everywhere
hnOsmium0001 has joined #lisp
ggole has quit [Quit: Leaving]
<flip214> even python copied the "with ..." naming
jibanes has quit [Ping timeout: 264 seconds]
liberliver has quit [Ping timeout: 240 seconds]
jibanes has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #lisp
ex_nihilo has joined #lisp
kevingal has quit [Ping timeout: 260 seconds]
<aeth> kenran: destructors for FFI stuff is just going to be a source of bugs
<aeth> probably because some things will still be around on the next run because you're running it from the same REPL
v3ga has joined #lisp
<mister_m> sort of a tangent but is it necessary to always explicitly list what files asdf needs for the :components attribute? Is there a way to intelligently discover them all - as well as what order to load them in through some sort - through providing say the location of a folder to search in?
<mister_m> or a combination of a folder / entry point
<jackdaniel> you may define a component that searches for all lisp files in the directory
<jackdaniel> but asdf doesn't have that predefined
<mister_m> I see
Achylles has joined #lisp
<tfb> kenran: the problem with finalizers is you have no idea when or if they run in a GCd language.
phireh has joined #lisp
<phireh> Noob question: how can I compile a package after loading it with quicklisp? I'm trying to execute the cepl examples
andreyorst has quit [Ping timeout: 256 seconds]
<tfb> kenran: another Lisp pattern is the call-with-x / with-x pattern, where (with-x (c) ...) expands to (call-with-x (lambda (c) ...))
andreyorst has joined #lisp
liberliver has joined #lisp
fdddd has quit [Remote host closed the connection]
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #lisp
Achylles has quit [Quit: Leaving]
andreyorst has quit [Ping timeout: 268 seconds]
tfb has quit []
jibanes has quit [Ping timeout: 246 seconds]
pankajsg has quit [Ping timeout: 268 seconds]
<rpg> mister_m: If you did that, how would you know what were the dependencies between the files in the system/
jibanes has joined #lisp
<rpg> mister_m, jackdaniel : "Here's a heap of lisp files, ASDF, do something with them."
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
<mister_m> that's where a topological sort would be needed
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #lisp
<borodust> fdddd: this dude that wrote that bodge.asd don't know how to write proper lisp, you really shouldn't follow any of his practices
<mister_m> I don't know if it is odd or not that asdf does not have that baked in, but I don't really think about this in other langs
C-16 has joined #lisp
Stanley00 has joined #lisp
<pve> If you ensure that the files in a folder/module can be loaded in any order, then couldn't you specify dependencies at the module level instead?
C-16 has quit [Client Quit]
Stanley00 has quit [Ping timeout: 256 seconds]
jibanes has quit [Ping timeout: 268 seconds]
EvW has quit [Ping timeout: 268 seconds]
<pve> not that it would be all that useful..
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
Fare has quit [Ping timeout: 260 seconds]
duuqnd has joined #lisp
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
Fare has joined #lisp
EvW has joined #lisp
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
<rpg> mister_m: The reason that you don't see this in, for example, make, is that make builds individual artifacts in separate processes. ASDF assembles both the file artifacts *and the running image*, and maintaining the integrity of the running image is tricky
<rpg> pve: Yes, you could.
jibanes has joined #lisp
<pve> rpg: ok, nice
<rpg> pve: But ASDF won't discover the set of files in a directory for you and treat them as a module.
<pve> rpg: yeah you need to define your own module, as jackdaniel said
<pve> something like that might actually be useful in quick 'n' dirty situations
zacts has joined #lisp
zacts has quit [Client Quit]
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
jw4 has quit [Read error: Connection reset by peer]
jibanes has quit [Ping timeout: 256 seconds]
jw4 has joined #lisp
jibanes has joined #lisp
zmagii has joined #lisp
fanta1 has quit [Remote host closed the connection]
cosimone has joined #lisp
aeth has quit [Ping timeout: 268 seconds]
jibanes has quit [Ping timeout: 256 seconds]
aeth has joined #lisp
jibanes has joined #lisp
narimiran has quit [Ping timeout: 246 seconds]
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
iarebatm` has joined #lisp
iarebatman has quit [Ping timeout: 264 seconds]
iarebatm` has quit [Ping timeout: 256 seconds]
wsinatra has quit [Quit: WeeChat 3.0]
scymtym has quit [Ping timeout: 268 seconds]
zacts has joined #lisp
shka_ has quit [Ping timeout: 268 seconds]
skapata has quit [Ping timeout: 272 seconds]
scymtym has joined #lisp
zacts has quit [Quit: leaving]
jibanes has quit [Ping timeout: 246 seconds]
skapata has joined #lisp
pve has quit [Quit: leaving]
jibanes has joined #lisp
cairn has quit [Changing host]
cairn has joined #lisp
kenran has quit [Quit: leaving]
Stanley00 has joined #lisp
dhil has quit [Ping timeout: 268 seconds]
Stanley00 has quit [Ping timeout: 268 seconds]
daphnis has joined #lisp
orivej has joined #lisp
aartaka has quit [Ping timeout: 256 seconds]
matryoshka has quit [Read error: Connection reset by peer]
matryoshka has joined #lisp
daphnis has quit [Ping timeout: 240 seconds]
arbv has quit [Ping timeout: 256 seconds]
Steeve has joined #lisp
arbv has joined #lisp
notzmv` is now known as notzmv
notzmv has quit [Changing host]
notzmv has joined #lisp
EvW has quit [Ping timeout: 260 seconds]
dbotton has quit [Quit: This computer has gone to sleep]
skapata has quit [Ping timeout: 272 seconds]
skapata has joined #lisp
daphnis has joined #lisp
EvW has joined #lisp
notzmv has quit [Remote host closed the connection]
daphnis has quit [Ping timeout: 240 seconds]
notzmv has joined #lisp
daphnis has joined #lisp
Alfr has quit [Quit: Leaving]
kam1 has joined #lisp
terrorjack has quit [Quit: Ping timeout (120 seconds)]
kam1 has quit [Read error: Connection reset by peer]
terrorjack has joined #lisp
TMA has quit [Ping timeout: 265 seconds]
TMA has joined #lisp
sjl has quit [Ping timeout: 260 seconds]
mfiano has quit [Ping timeout: 256 seconds]
zacts has joined #lisp
zacts has quit [Client Quit]
rgherdt has quit [Ping timeout: 260 seconds]
akoana has joined #lisp
Blukunfando has joined #lisp
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
random-nick has quit [Ping timeout: 272 seconds]
Alfr has joined #lisp
cosimone has quit [Quit: cosimone]