jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.5.4, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
iovec has quit [Quit: Connection closed for inactivity]
ralt has quit [Quit: Connection closed for inactivity]
slyrus_ has joined #lisp
slyrus__ has quit [Ping timeout: 268 seconds]
monokrom has quit [Remote host closed the connection]
shifty has joined #lisp
vms14 has joined #lisp
elfmacs has joined #lisp
varjag has joined #lisp
EvW has joined #lisp
varjag has quit [Ping timeout: 268 seconds]
efm has quit [Ping timeout: 240 seconds]
libertyprime has joined #lisp
sahara3 has left #lisp [#lisp]
ArthurStrong has joined #lisp
efm has joined #lisp
khisanth__ has quit [Ping timeout: 276 seconds]
khisanth__ has joined #lisp
oni-on-ion has quit [Ping timeout: 245 seconds]
oni-on-ion has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
bitmapper has quit [Ping timeout: 245 seconds]
ArthurStrong has quit [Quit: leaving]
v88m has joined #lisp
libertyprime has quit [Ping timeout: 240 seconds]
libertyprime has joined #lisp
oni-on-ion has quit [Ping timeout: 250 seconds]
wiselord has quit [Ping timeout: 240 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
sjl has joined #lisp
oni-on-ion has joined #lisp
ebrasca has quit [Remote host closed the connection]
stepnem_ has joined #lisp
stepnem has quit [Ping timeout: 265 seconds]
EvW has quit [Ping timeout: 250 seconds]
lavaflow has quit [Quit: WeeChat 2.6]
shifty has quit [Ping timeout: 268 seconds]
vms14 has quit [Remote host closed the connection]
oni-on-ion has quit [Ping timeout: 250 seconds]
oni-on-ion has joined #lisp
dddddd has quit [Ping timeout: 246 seconds]
davepdotorg has joined #lisp
oni-on-ion has quit [Ping timeout: 250 seconds]
malfort has joined #lisp
davepdotorg has quit [Ping timeout: 265 seconds]
oni-on-ion has joined #lisp
davepdotorg has joined #lisp
quazimodo has quit [Ping timeout: 268 seconds]
quazimodo has joined #lisp
Jeanne-Kamikaze has joined #lisp
davepdotorg has quit [Ping timeout: 240 seconds]
DGASAU has quit [Read error: Connection reset by peer]
DGASAU has joined #lisp
<no-defun-allowed> Are there any clients for the SOCKS proxy protocol?
<reepca> weird question: is it normal for it to be possible to evaluate lisp code but not compile it? As in, I can copy+paste it into the REPL and it'll work fine, but trying to compile it with C-c C-k causes an error?
libertyprime has quit [Ping timeout: 245 seconds]
<reepca> I've narrowed it down to this sample: http://paste.debian.net/1120299
<reepca> It gets to "Got here 1", then produces a condition of type SB-INT:BUG
libertyprime has joined #lisp
<reepca> Due to my distribution's packaging of flexi-streams and usocket, loading them produces a warning about not following "asdf version numbering convention", but aside from that they load fine when pasted into the repl
<Bike> it's not normal, but it's possible
<reepca> full error and backtrace for those skilled at making sense of it: http://paste.debian.net/1120300
oni-on-ion has quit [Ping timeout: 250 seconds]
<loke`> reepca: When you get a failed AVER, the first thuing to do is to make sure you have the latest version of SBCL
<loke`> They fix bugs all the time.
<reepca> hm, I've got 1.5.8, so I guess I'm one version behind
<loke`> I always build from Source
oni-on-ion has joined #lisp
<Bike> unfrotunately without the weird versioning this is kind of nontrivial to reproduce
<loke`> reepca: Wait, are you usin g the distrobutions packaging of Lisp librarioes?
<loke`> Don't do that
<loke`> You should uninstall all those packages, and then pull it using Quicklisp.
<Bike> still, it ought not to crash
<loke`> Well, sure. But there is no way we'll ever be able to invesigate unless we know they're not using 10 year old versions of some random library (which tends to happen with Debian in particular)
<Bike> calling asdf/parse-defsystem::parse-version manually doesn't break for me
<Bike> though i'm not calling with the component and stuff
malfort has quit [Remote host closed the connection]
malfort has joined #lisp
enrio has joined #lisp
libertyprime has quit [Ping timeout: 268 seconds]
nullniverse has joined #lisp
nullniverse has joined #lisp
nullniverse has quit [Changing host]
libertyprime has joined #lisp
tsrt^ has quit []
torbo has joined #lisp
Bike has quit [Quit: Lost terminal]
Jeanne-Kamikaze has quit [Quit: Leaving]
<ck_> no-defun-allowed: firefox is a client for the SOCKS proxy protocol
clothespin_ has joined #lisp
libertyprime has quit [Ping timeout: 268 seconds]
gravicappa has joined #lisp
libertyprime has joined #lisp
<beach> Good morning everyone!
<LdBeth> Hello beach
<LdBeth> I get stuck at AoC Day 7
orivej has quit [Ping timeout: 240 seconds]
<LdBeth> What I naturally think it the emulator returns a closure preserves the execution state when executing IO instruction
<beach> LdBeth: The grammar of your last phrase is strange, so I can't parse it.
<ck_> try s/it/is,/ and s/preserves/which preserves/
<LdBeth> Sorry for that
<beach> ck_: My brain is to small to attempt such things.
<fengshaun> it looks like (loop for x in xs sum x into y finally (+ y 2)) doesn't work and returns nil. I have a list of numbers I want to sum but then want to do something at the end while x points to the last element. I can think of a way to do it with (do), but can I do it with (loop)?
<beach> fengshaun: finally (return ...)
<fengshaun> *return*, thanks
<LdBeth> Mine is also small that has run out all energy trying solve that question that it does not have enough for structuring sentence correctly
enrio has quit [Ping timeout: 276 seconds]
orivej has joined #lisp
malfort_ has joined #lisp
malfort has quit [Ping timeout: 268 seconds]
libertyprime has quit [Quit: leaving]
oni-on-ion has quit [Ping timeout: 250 seconds]
<White_Flame> fengshaun: only accumulation clauses return a value from LOOP, else you get NIL without a manual return
<fengshaun> that makes sense, thanks
<White_Flame> so you could do (loop ... collect x finally (do-cleanup)) and still get X collected
<fengshaun> without explicit return?
vlatkoB has joined #lisp
<White_Flame> right, COLLECT defines the value that would return from LOOP
<White_Flame> it's an accumulation clause: collect, append, nconc, count, sum, etc
<fengshaun> nice, thanks
<White_Flame> if you use RETURN, you would usurp that, and it would be consing up the COLLECT value needlessly, afaik
<fengshaun> oh, so double conses
jeosol has quit [Ping timeout: 260 seconds]
torbo has quit [Remote host closed the connection]
enrio has joined #lisp
davepdotorg has joined #lisp
davepdotorg has quit [Ping timeout: 265 seconds]
Inline has quit [Quit: Leaving]
<aeth> White_Flame: well, no, what you'd do if you needed to is you'd :collect the-thing :into a-variable and then you could :finally (return (values a-variable whatever-else))
<White_Flame> yep, but :collect x :finally (return something-else) wastes the collection work
<aeth> It's fairly common to use two collects to generate two different lists depending on some condition
<aeth> right
sindan has quit [Remote host closed the connection]
sindan has joined #lisp
<equwal> What are some active biology related projects in CL? Obviously there is Clasp.
<equwal> Looking to add things to this subreddit.
<fengshaun> how do you collect depending on condition, I had to inject bogus values if a condition wasn't met and then filtered the resulting list
<equwal> push/nreverse
<White_Flame> :when (condition) :collect var
<reepca> fengshaun: conditional clauses apply to loop clauses, including accumulation clauses
<fengshaun> :when thanks!
<fengshaun> I need to keep that periodic table of loop clauses handy
<fengshaun> time to bed for now! thanks for the helps
smokeink has joined #lisp
<reepca> Simplified that error from before into a hopefully-reproducible form: http://paste.debian.net/1120305
<reepca> still produces a "failed AVER" error
<reepca> when compiled, but not when evaluated
brown121408 has quit [Ping timeout: 240 seconds]
brown121407 has joined #lisp
space_otter has quit [Read error: Connection reset by peer]
space_otter has joined #lisp
<equwal> fengshaun: or don't loop -- iterate.
<reepca> building sbcl 1.5.9, will see if the error occurs there too...
Kaisyu7 has quit [Ping timeout: 250 seconds]
jeosol has joined #lisp
enrioog has joined #lisp
EvW has joined #lisp
enrio has quit [Ping timeout: 250 seconds]
_whitelogger has joined #lisp
malfort_ has quit [Ping timeout: 250 seconds]
enrio has joined #lisp
enrioog has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 265 seconds]
otwieracz has joined #lisp
enrio has quit [Ping timeout: 250 seconds]
Lycurgus has joined #lisp
enrio has joined #lisp
JohnMS_WORK has joined #lisp
enrioog has joined #lisp
enrio has quit [Ping timeout: 268 seconds]
malfort_ has joined #lisp
EvW has quit [Ping timeout: 246 seconds]
Bourne has joined #lisp
flamebeard has joined #lisp
smokeink has joined #lisp
orivej has joined #lisp
kritixilithos has joined #lisp
scymtym has quit [Ping timeout: 268 seconds]
Duuqnd has joined #lisp
smokeink has quit [Remote host closed the connection]
frgo has quit [Ping timeout: 265 seconds]
jello_pudding has joined #lisp
shka_ has quit [Ping timeout: 265 seconds]
jello_pudding has quit [Client Quit]
jello_pudding has joined #lisp
jello_pudding has quit [Client Quit]
<reepca> is there a preferred way to "strip away" the fill-pointer and adjustable properties of an array, giving a simple-array?
<phoe> reepca: write a function that does: if the array is simple, return it; otherwise, call alexandria:copy-array with all properties set to NIL
<reepca> experimentally, copy-seq also seems to work
* beach should provide a function in SICL to do that, since all arrays are simple and all vectors have a slot for the fill pointer (but it might have the contents NIL, of course).
<beach> So all it takes is to set that slot to NIL to accomplish the desired effect.
frgo has joined #lisp
malfort_ has quit [Ping timeout: 250 seconds]
varjag has joined #lisp
reepca has quit [Ping timeout: 268 seconds]
scymtym has joined #lisp
DGASAU has quit [Read error: Connection reset by peer]
DGASAU has joined #lisp
Cymew has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
space_otter has quit [Remote host closed the connection]
Lycurgus has quit [Quit: https://meansofproduction.biz Exit Quassel.]
lavaflow has joined #lisp
enrioog has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
enrioog has joined #lisp
mingus has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
Grauwolf has quit [Quit: WeeChat 2.5]
Grauwolf has joined #lisp
CrazyEddy has quit [Ping timeout: 252 seconds]
orivej has quit [Ping timeout: 240 seconds]
hhdave has joined #lisp
jonatack has quit [Ping timeout: 250 seconds]
ir0nbutt has joined #lisp
akoana has left #lisp ["Leaving"]
ironbutt has quit [Ping timeout: 250 seconds]
_whitelogger has joined #lisp
jonatack has joined #lisp
wiselord has joined #lisp
dddddd has joined #lisp
ljavorsk has joined #lisp
gxt has quit [Ping timeout: 260 seconds]
jonatack has quit [Ping timeout: 240 seconds]
DGASAU has quit [Read error: Connection reset by peer]
jonatack has joined #lisp
gxt has joined #lisp
ljavorsk has quit [Ping timeout: 250 seconds]
DGASAU has joined #lisp
stux|RC has quit [Ping timeout: 265 seconds]
Lord_of_Life has quit [Read error: Connection reset by peer]
smokeink has joined #lisp
rotucer has quit [Ping timeout: 276 seconds]
Lord_of_Life has joined #lisp
rotucer has joined #lisp
djeis[m] has quit [Quit: killed]
akanouras has quit [Quit: killed]
LdBeth has quit [Quit: killed]
shaakyamuni[m] has quit [Quit: killed]
rudi has quit [Quit: killed]
eriix[m] has quit [Quit: killed]
EuAndreh[m] has quit [Quit: killed]
katco has quit [Quit: killed]
no-defun-allowed has quit [Quit: killed]
malaclyps[m] has quit [Quit: killed]
Jachy has quit [Quit: killed]
Gnuxie[m] has quit [Read error: Connection reset by peer]
nonlinear[m] has quit [Quit: killed]
jackdaniel has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
pilne has quit [Quit: Oh, so they have Internet on computers now!]
jackdaniel has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
shifty has joined #lisp
pjb` has joined #lisp
karlosz has joined #lisp
oxum has joined #lisp
pjb has quit [Ping timeout: 276 seconds]
pjb` has quit [Ping timeout: 246 seconds]
stux|RC has joined #lisp
ebrasca has joined #lisp
Guest75462 has quit [Read error: Connection reset by peer]
Guest75462 has joined #lisp
<phoe> minion: memo for reepca: oh, if you have a one-dimensional array, then COPY-SEQ will work, yes
<minion> Remembered. I'll tell reepca when he/she/it next speaks.
froggey has quit [Ping timeout: 276 seconds]
karlosz has quit [Quit: karlosz]
froggey has joined #lisp
pjb` has joined #lisp
DGASAU has quit [Ping timeout: 265 seconds]
pjb` has quit [Client Quit]
pjb has joined #lisp
pjb is now known as Guest74879
Guest74879 has quit [Client Quit]
pjb has joined #lisp
DGASAU has joined #lisp
karlosz has joined #lisp
JohnMS_WORK has quit [Read error: Connection reset by peer]
JohnMS_WORK has joined #lisp
cosimone has joined #lisp
<phoe> beach: do you have any protocol for switching between first-class environments?
trittweiler has joined #lisp
<phoe> Macros won't necessarily work, since they happen too late. (WITH-ENVIRONMENT (FIND-ENVIRONMENT :FOO) BAR:BAZ) will not even compile if the current environment does not have the package BAR or its external symbol BAZ.
<phoe> I mean, that isn't really switching - it's executing statements cross-environment.
jackdaniel has joined #lisp
<trittweiler> Greetings from sbcl20 :)
<phoe> trittweiler: tell everyone that the new SBCL logo is awesome
<splittist> reepca: COERCE ?
oxum has quit [Read error: Connection reset by peer]
<phoe> splittist: COERCE might not get rid of the fillpointer or adjustability
<pjb> Note: there's no type specifier for fill-pointer-less vectors.
<pjb> You would have to use satisfies and the only way to detect a fill-pointer-less vectors is to try fill-pointer and catch a type-error. Which is strange since there's no type specifier for fill-pointer-less (or fill-pointer) vectors…
jackdaniel has quit [Read error: Connection reset by peer]
<pjb> When I say that types are useless…
<pjb> beach: does sicl give a type-error on (fill-pointer (make-array 3 :fill-pointer nil))?
ggole has joined #lisp
<pjb> well, there is a semi-predicate, so (and array (satisfies array-has-fill-pointer-p))
smokeink has quit [Ping timeout: 250 seconds]
rgherdt has joined #lisp
EuAndreh[m] has joined #lisp
Jachy has joined #lisp
djeis[m] has joined #lisp
Gnuxie[m] has joined #lisp
nonlinear[m] has joined #lisp
malaclyps[m] has joined #lisp
eriix[m] has joined #lisp
akanouras has joined #lisp
katco has joined #lisp
no-defun-allowed has joined #lisp
shaakyamuni[m] has joined #lisp
LdBeth has joined #lisp
rudi has joined #lisp
shifty has quit [Ping timeout: 245 seconds]
shifty has joined #lisp
jackdaniel has joined #lisp
karlosz has quit [Quit: karlosz]
jackdaniel has quit [Read error: Connection reset by peer]
karlosz has joined #lisp
jmercouris has joined #lisp
jackdaniel has joined #lisp
Necktwi has quit [Ping timeout: 265 seconds]
jackdaniel has quit [Read error: Connection reset by peer]
<phoe> beach: one would need a reader macro that can store the form to evaluate in a string and then call EVAL READ-FROM-STRING in the new environment. The Lisp reader cannot reliably work cross-environment because of the differences in read-time environment state (readtables, packages, symbols, etc..).
ljavorsk has joined #lisp
cosimone has quit [Quit: Terminated!]
zmt00 has joined #lisp
zmt01 has quit [Ping timeout: 245 seconds]
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
karlosz has quit [Client Quit]
jmercouris has quit [Ping timeout: 268 seconds]
<Xach>
karlosz has joined #lisp
efm has quit [Read error: Connection reset by peer]
jmercouris has joined #lisp
kritixil1 has joined #lisp
kritixil1 has quit [Client Quit]
kritixil1 has joined #lisp
efm has joined #lisp
kritixilithos has quit [Ping timeout: 260 seconds]
kritixil1 has quit [Client Quit]
kritixilithos has joined #lisp
<phoe> Xach: yes
<Xach> I still can't see a way out
anewuser has joined #lisp
_jrjsmrtn has quit [Ping timeout: 250 seconds]
__jrjsmrtn__ has joined #lisp
orivej has joined #lisp
zmv has joined #lisp
ljavorsk has quit [Ping timeout: 268 seconds]
freyr69 has joined #lisp
<freyr69> How to unwind the stack and ignore the error within a handler-bind's handler?
<freyr69> Instead of doing invoke-restart
<jdz> freyr69: You have to do a non-local control transfer.
<jdz> freyr69: Like have a surrounding block and do RETURN, or use CATCH/THROW.
<jdz> TAGBODY with GO should also work.
frgo has quit [Remote host closed the connection]
<freyr69> By what means? throwing an exception?
<freyr69> Ah, I see
ljavorsk has joined #lisp
<jdz> clhs 5.2
<specbot> Transfer of Control to an Exit Point: http://www.lispworks.com/reference/HyperSpec/Body/05_b.htm
<freyr69> Thanks
frgo has joined #lisp
EvW has joined #lisp
patlv has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
<_death> Xach: I agree that this is an issue.. I remember using :verbose t with some of my systems and finding helpful warnings..
random-nick has joined #lisp
frgo has joined #lisp
jmercouris has quit [Ping timeout: 250 seconds]
ljavorsk has quit [Ping timeout: 246 seconds]
<_death> Xach: and it gets worse over time because it sweeps warnings under a rug and people who don't use :verbose t now and then don't know about them
Bike has joined #lisp
<phoe> Xach: hm
<phoe> can this be achieved without modifying ASDF?
<mfiano> I agree it is an issue, and being able to differentiate "infrastructury" codes from not would be useful, but I'm happy with #+quicklisp(setf ql:*quickload-verbose* t) in my implementation init file. I find a lot of bugs that are reported to infrastructure codes with this, even if it is always verbose.
<freyr69> jdz: Surprisingly, return-from doesn't work, or at least not as I would expect
<freyr69> What did I do wrong
<phoe> freyr69: wrong indentation
karlosz has quit [Quit: karlosz]
<phoe> the second ERROR form is actually another handler in HANDLER-BIND
<phoe> and not the body
wiselord has quit [Ping timeout: 265 seconds]
<phoe> (block test (handler-bind ((error (lambda (ignore) (return-from test 42)))) (error "Error")))
<phoe> this is properly parenthesized and returns 42
<freyr69> Ah, shame on me. Quite right you are
<phoe> you should try using an editor that automatically indents code for you, so you notice such mistakes early - emacs with aggressive-indent-mode does this for me and it automatically indented the form by its actual semantical meaning instead of the one you tried to convey by manual indentation
<phoe> it's practical for me - I can forget about a whole class of parenthesisation bugs like this.
<freyr69> I use emacs and slime, I was just trying this in repl and all the fancy parmatch stuff doesn't work there for me out of the box for some reason
<freyr69> Editing buffer shows this just fine
<phoe> freyr69: I pasted this into a code buffer, not a REPL buffer - I couldn't get aggressive indent mode to work there for some reason
bitmapper has joined #lisp
<phoe> Xach: I ask because I could take a break from shoveling cruft outta CCL to get to know ASDF and try to implement something like selective verbosity - e.g. only be verbose when loading systems (:foo :bar :baz) and nothing else, including their dependencies
<phoe> so basically when you tell ASDF to be quiet, you also get to tell it "be quiet, except for..."
<phoe> I think that would be a solution
cosimone has joined #lisp
freyr69 has left #lisp ["ERC (IRC client for Emacs 27.0.50)"]
<Xach> phoe: i think what i want is "establish some dynamic environment when loading a system based on some property of the system, whether recursively or not"
<Xach> and this is as a third party - can't use around methods safely
Duuqnd has quit [Quit: Leaving]
<Xach> the "property" might be intrinsic to the system but could easily be from looking up the system's name in some table to learn about it
<Xach> or look at some piece of the filesystem path of the definition, etc
<phoe> Xach: so basically a per-system dynamic environment
lucasb has joined #lisp
<phoe> as if you could wrap a PROGV around each operation and be able to supply the vars and vals, something like that?
<Xach> phoe: yes
<Xach> phoe: i was thinking about doing a special case - when looking up systems and one is found that is provided by quicklisp, wrap it in a stub system that can be specialized safely, and store the "real" system to do the real work in it
Lord_of_Life_ has joined #lisp
jackdaniel has joined #lisp
<Xach> but that has its own problems - the search function returns a pathname currently and i'm not sure how best to return a stub system instead
Lord_of_Life has quit [Ping timeout: 240 seconds]
jackdaniel has quit [Read error: Connection reset by peer]
Lord_of_Life_ is now known as Lord_of_Life
<phoe> Xach: I'd still prefer to modify ASDF in a programmable way - a PROGV around each operation does seem like a good choice for me. Preferably then document it as something that is explicitly meant to be used by end-users only and not as a part of system definition, so we can at least try to avoid the ASDF ecosystem becoming an even bigger clusterfuck than it is now.
<phoe> This way, an empty PROGV is a PROGN, so we have a no-op unless the user explicitly specifies the vars and vals to be rebound around each operation.
<Xach> phoe: If some other way can be found it would be good, because of the uncertainty of asdf updates and their propagation to implementations
ljavorsk has joined #lisp
<phoe> Xach: correct. I'll dig into the manuals and the code later to figure out if the current structure allows for such a hack.
<phoe> I know that ASDF is upgradeable on its own though, so you, as an end user, could explicitly load a newer/patched ASDF over an old one.
<_death> maybe asdf has (or should have) a hook that can be called when a system is loaded?
<Xach> _death: ha ha ha
<_death> often complex systems lack basic usability features :)
<Xach> phoe: i don't think progv suffices
<Xach> the environment i want to establish includes handler binds
gabiruh has joined #lisp
<phoe> Xach: OK, so you'll want arbitrary code execution. That would indeed mandate something like *macroexpand-hook*.
<_death> but as you can see, naughty around method
<phoe> the issue is that we can't easily compose these
<phoe> as easily as an asdf:*operate-hook* would allow us to
<Xach> _death: i think the around method could break things
<_death> right.. asdf should provide a way to do it safely
ljavorsk has quit [Ping timeout: 265 seconds]
<phoe> > Note that there is no around-load hook. This is on purpose. Some implementations such as ECL, GCL or MKCL link object files, which allows for no such hook. Other implementations allow for concatenating FASL files, which doesn’t allow for such a hook either. We aim to discourage something that’s not portable, and has some dubious impact on performance and semantics even when it is possible. Things you
<phoe> might want to do with an around-load hook are better done around-compile, though it may at times require some creativity (see e.g. the package-renaming system).
<phoe> the same chapter describes a thing called :compile-check
<phoe> > Using this hook, you may achieve such effects as: locally renaming packages, binding *readtables* and other syntax-controlling variables, handling warnings and other conditions, proclaiming consistent optimization settings, saving code coverage information, maintaining meta-data about compilation timings, setting gensym counters and PRNG seeds and other sources of non-determinism, overriding the
<phoe> source-location and/or timestamping systems, checking that some compile-time side-effects were properly balanced, etc.
<phoe> > handling warnings and other conditions
<phoe> Xach: this smells of what you described earlier
<Xach> phoe: that is part of :compile-check?
<phoe> or rather, :around-compile
<Xach> phoe: i worry that it is intended for system *authors* and not system *loaders* like quicklisp
<Xach> that is, the :around-compile must be written directly into the system definition
<phoe> hmmmm
<phoe> if that is so, then you could let ASDF load the system definition
<phoe> and then write your own code that hacks into the system definition objects and sets your own :around-compile hooks that executes your code and then calls the previous ones
<phoe> this should be equivalent to an *asdf-load-hook* that only executes when particular systems are being compiled
<phoe> and you'll get to execute arbitrary code, which is what you want.
<phoe> and it doesn't require ASDF modifications or upgrades
<Xach> Hmm
<phoe> does it sound sane^Wplausible?
<Xach> it sounds possible. now i wonder where best to intercede.
<phoe> ql:quickload calls asdf:load-system. It could call asdf:load-system-definition or whatever function exists that instantiates the system definition objects *without* loading any actual code.
<phoe> Once the objects are instantiated, mutate them as appropriate.
malfort_ has joined #lisp
<phoe> Then call asdf:load-system as usual.
<Xach> phoe: but what of recursive calls?
<Xach> that is automatic
<_death> what about load-time warnings? Xach is right that this reasoning seems to apply to system authors.. after all, the concatenated fasl or whatever gets loaded and it may be useful to have a hook for that
<phoe> Xach: my question is whether it is possible for ASDF to create the whole system tree without loading any code
<Xach> phoe: i don't think so.
<phoe> how does it compute dependencies then
<phoe> it can't load code for FOO without loading BAR that is its dependency
<phoe> so it needs to first figure out what is the system definition for BAR
<phoe> and that it has another dependency that is BAZ
<phoe> et cetera, et cetera
<Xach> phoe: I mean that asdf system files are lisp programs and may do anything
<Xach> phoe: some files load things on their own
<Xach> You can't simply look at the system definition form and have universal success
<Xach> there is also :defsystem-depends-on
<Xach> That will load code in order to load the system definition
patlv has quit [Ping timeout: 265 seconds]
<phoe> sigh, that is correct
karlosz has joined #lisp
karlosz has quit [Remote host closed the connection]
<phoe> this means that it's impossible to have that without digging into ASDF
shifty has quit [Ping timeout: 246 seconds]
<beach> phoe: I don't have a protocol for switching environments.
shifty has joined #lisp
<phoe> beach: OK, understood.
<beach> pjb: I haven't actually written those functions yet, but the Common Lisp HyperSpec says that an error should be signaled if the vector does not have a fill pointer, so I think I will always signal an error.
jonatack has quit [Read error: Connection reset by peer]
malfort_ has quit [Quit: Leaving]
malfort has joined #lisp
<beach> pjb: Actually, that particular one is written and it does signal an error when the vector does not have a fill pointer.
pfdietz has joined #lisp
_paul0 has joined #lisp
<beach> phoe: Environments are not packages, so it is not the reader that is the problem.
<pjb> beach: ok. I understood that your vectors always have a slot for a fill-pointer, filled with NIL when the vector has no fill-pointer. So I wanted to check that FILL-POINTER didn't just return this slot.
<beach> pjb: Right, it does not. The accessor for the slot is called sicl-arrary:vector-fill-pointer.
paul0 has quit [Ping timeout: 252 seconds]
megalography has joined #lisp
<phoe> beach: yes. I thought of the issue from a usability perspective though - I have an environment, and I would like to evaluate some code inside it. That code can't be in form of Lisp data since Lisp data depends on the properties of its environment (most notably: symbols) in order to exist and function.
<beach> That is not true.
<beach> You can do (sicl-global-environment:eval <form> <environment>).
amerlyq has joined #lisp
<beach> Symbols are valid across environment.
<phoe> beach: Can each symbol have a different home package in each environment?
<beach> No.
<beach> The package is a slot in the symbol.
cosimone has quit [Quit: Terminated!]
<phoe> So if I can access a symbol, then I can access and uniquely identify its package, correct?
clothespin_ has quit [Ping timeout: 265 seconds]
<beach> Yes.
<beach> (SYMBOL-PACKAGE <symbol>)
<phoe> Hm.
<phoe> But each environment has its own package table.
<phoe> So it is possible for two symbols to have the name "MAKE-THREAD" and for each of them to have a home package named "BORDEAUX-THREADS".
<Bike> but they'd be different packages
<phoe> But the two packages can be in separate package tables that belong to different environments.
<beach> phoe: Wow, hold on!
<phoe> If so, which symbol is utilized when I do (sicl-global-environment:eval '(bordeaux-threads:make-thread ...) my-environment)?
<phoe> beach: OK, holding on.
<beach> phoe: Er, yes, I think that's true.
<beach> Let me think...
karlosz has joined #lisp
<Bike> the symbol that's read in whatever environment that's read in, no?
<beach> I think it will be the same situation as with FIND-CLASS.
<phoe> I think that the Lisp reader reads and interns the symbol in the global environment.
<phoe> That symbol is then passed over to being evaluated in MY-ENVIRONMENT.
<beach> So Bike is right.
<Bike> what it does is use find-package relative to a global environment
<Bike> so it'll get the bordeaux-threads package in place at that time
<Bike> not my-environment, unless they happen to be the same.
<phoe> So we can't easily pass symbols to SICL-G-E:EVAL without leaking information from the global environment.
elfmacs has quit [Ping timeout: 276 seconds]
<beach> phoe: They symbol contains no information about the global environment.
<beach> s/y//
<Bike> what the environment has is a mapping from package names to packages. packages are not part of environments per se. as far as i understand.
<beach> Bike is right again.
<Bike> so, yes, in this situation you could get an unbound function error.
<phoe> Does the symbol have a slot with the name of its home package, or its home package?
<Bike> its home package.
<beach> Bike is right.
<Bike> i should just let you explain, huh
<beach> No.
<beach> You are doing fine.
<phoe> So S-G-E:EVAL gets a symbol that refers to a package that is not known in the local environment. Hmm.
<Bike> right, so it'll be unfbound, probably
<beach> Very likely.
orivej has quit [Ping timeout: 240 seconds]
<phoe> So we can't easily (s-g-e:eval '(bt:make-thread ...) my-env).
<Bike> well what do you want to do exactly
<phoe> We'd need to (s-g-e:eval (list (find-symbol "MAKE-THREAD" "BT" my-env) ...) my-env)
<phoe> I'm thinking from a user perspective - "I'd like to evaluate some code in an environment that I just created"
<_death> I guess phoe wants to map symbols to symbols, sublis style
<Bike> "evaluate code in an environment" is kind of a nontrivial concept i guess
<phoe> like, make a thread in the new environment - because I just loaded a custom version of bordeaux-threads in it
<phoe> and I want to check how it behaves
<Bike> like if the code is the form, you ought to construct it in your environment as well
<Bike> that doesn't seem weird to me
<phoe> hmm
<beach> phoe: Environments are not meant to be fine-grained things, as opposed to modules.
<phoe> so cross-environment evaluation doesn't work unless we either make a big circle to only construct the form using symbols from the target environment, or just read from strings
<phoe> I see
<Bike> of course you could also just do (funcall (find-symbol "MAKE-THREAD" (find-package "BT" my-env)) ...)
<_death> phoe: but in such scenarios you'll want only some symbols to be mapped, not all
<phoe> _death: what do you mean?
<beach> phoe: The most likely scenario is that you would evaluate something like SWITCH-ENVIRONMENT, work for a while there, perhaps export a function or two to a different environment, then switch again.
<_death> phoe: I mean sharing information, such as symbols, between environments
trittweiler has quit [Remote host closed the connection]
<phoe> beach: I see, so basically a magical operator that is guaranteed to be the same in all environments and allows you to switch around, unless you want to jail some code in a particular environment.
<_death> phoe: so you may want only env1:bt:make-thread to be replaced with env2:bt:make-thread (and then, you may want that only when it's in operator position.. so you actually want a walker)
<phoe> _death: yes, and this becomes even more complex and error-prone at this point
EvW has quit [Ping timeout: 245 seconds]
Lycurgus has joined #lisp
<beach> phoe: If I understand you correctly, that sounds right.
<phoe> beach: OK, I understand that.
<beach> phoe: In this case, you might have a particular environment containing BORDEAUX-THREADS and perhaps systems that it uses.
<phoe> beach: and possibly (s-g-e:eval (translate-form '(bt:make-thread ...) my-env) my-env)
<beach> phoe: You would then export the functions, classes, etc. in the protocol to your usual work environment.
<phoe> where TRANSLATE-FORM attempts to walk the code and do what _death described
Achylles has joined #lisp
<phoe> of course, it won't work in every case - e.g. when I have BT only loaded in my-env
<beach> There is no reason why any translation would have to be made.
<phoe> beach: convenience
<Bike> ok, so the scenario here is we want to make a change to bt and test it?
<phoe> I'd like to be able to write (s-g-e:eval '(bt:make-thread ...) my-env) even though the Lisp reader would normally choke on it because there is no package BT in the global environment
<phoe> Let's suppose BT is only loaded in MY-ENV
<phoe> Bike: yes
<Bike> we could write out our patched bt code, then make an environment, load the bt code in that environment, and then compile/load whatever other code we want to test in that environment
<Bike> wouldn't be doing anything like manual eval calls
<beach> phoe: Why on earth would there be not BT package in the current environment?
<_death> suppose you have (setf (get 'bt:make-thread 'danger-level) :moderate) that affects part of the system
<phoe> beach: e.g. because I haven't loaded BT in it
<beach> s/not/no/
<phoe> let's suppose that I have a package named DANGEROUS-PACKAGE that I only want to load in a separate environment because otherwise it could mess my stuff up.
<beach> phoe: You would share the BT package between the special environment and the current one.
<beach> phoe: It would be horribly inconvenient to use otherwise.
<phoe> beach: this implies that I can't have two versions of BT loaded at the same time, one in the global env, the other in the local one
karlosz has quit [Quit: karlosz]
<phoe> because if they share a package, then they can e.g. mutate each others' symbols
<beach> phoe: Sure you can. But the package would be the same.
<beach> phoe: Symbols are immutable, except for UNINTERN.
<Bike> bindings are also part of the environment.
davepdotorg has quit [Remote host closed the connection]
<phoe> ...oh wait a second
<phoe> ooh, I see now
oni-on-ion has joined #lisp
rgherdt has quit [Read error: Connection reset by peer]
<_death> so the symbol bt:make-thread is shared between the environments.. is there a scenario where this sharing is not desired? e.g., where find-symbol should return true in one and not in the other
<beach> _death: There could be, but I can't think of one.
<phoe> perhaps the case of unintern
<phoe> if you unintern a symbol in one environment, is it uninterned in the other one as well?
<beach> Yes, identity is preserved as usual.
<Bike> the symbol to package relation is not part of the environment
<_death> what about package visibility?
<Bike> well, what's in the environment here is the mapping from package names to packages. package use and stuff is part of packages, so it shouldn't be part of the environment.
jackdaniel has joined #lisp
<phoe> this is a possible jailbreak - if a hostile package I read uninterns bt:make-thread from :bt, then the global environment is affected by that
<phoe> because then I can no longer (bt:make-thread #'foo) in the global environment
<_death> phoe: so have unintern fbound to danger-will-robinson
<oni-on-ion> keep a copy of all symbols just in case =p
brown121407 has quit [Read error: Connection reset by peer]
jackdaniel has quit [Read error: Connection reset by peer]
brown121407 has joined #lisp
<Bike> that's the kind of thing that hasn't come up because beach has been working on this stuff for bootstrapping rather than for sandboxing. sandboxing is kind of hard.
<phoe> Yes, I see.
<Bike> environments might help but they're not a complete solution
<Bike> there are easier to understand problems, like functions that take function designator arguments
<phoe> yep
<beach> phoe: For scenarios regarding malware you would have to go from SICL to CLOSOS. The latter has capabilities that allow you to have different permissions etc.
<phoe> and there are also memory issues, such as preventing the whole system from going down due to one user (loop for x = nil then (cons x x)).
<phoe> beach: yes, I see now.
rmnull has joined #lisp
rmnull has left #lisp ["WeeChat 2.4"]
<beach> Right, quotas would also be part of CLOSOS, if I can figure out how.
wiselord has joined #lisp
<shka__> this is one of things that Racket seems to be doing well
anewuser has quit [Ping timeout: 265 seconds]
<phoe> shka__: how? Does it have any kind of multiuser quotas?
<oni-on-ion> how is CLOSOS these days
<shka__> phoe: ^^
<beach> oni-on-ion: It still doesn't exist.
<shka__> oni-on-ion: beach is working on SICL
nowhereman has joined #lisp
<phoe> shka__: I see, interesting.
<oni-on-ion> ahh =) hmm.
<shka__> phoe: Racket has a lot of stuff going for it
nowhere_man has quit [Ping timeout: 276 seconds]
<shka__> it also allows to control access to the files or network sockets
<_death> for CL there's a sandbox attempt here https://github.com/tlikonen/cl-eval-bot/tree/master/src .. I guess you could add quotas to potentially consing operations.. but I'd look into qemu :)
<shka__> _death: i recently found your minhash implementation in gist ;-)
<shka__> it was helpfull
davepdotorg has joined #lisp
davepdotorg has quit [Remote host closed the connection]
davepdot_ has joined #lisp
<_death> shka: cool.. I've lots of snippets like that.. helps me to understand and possible grow them later on if I need to
<phoe> anyway, popping one discussion off my stack
<phoe> Xach: I could try and take a look at the ASDF internals later
<beach> Bike: Thanks for all the help!
<phoe> beach: Bike: thank you two for explaining, too!
karlosz has joined #lisp
<beach> Anytime.
karlosz has quit [Client Quit]
slyrus__ has joined #lisp
DGASAU has quit [Read error: Connection reset by peer]
bitmapper has quit [Ping timeout: 240 seconds]
slyrus_ has quit [Ping timeout: 268 seconds]
DGASAU has joined #lisp
kajo has quit [Ping timeout: 250 seconds]
scymtym has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #lisp
Kevslinger has joined #lisp
frgo has quit [Remote host closed the connection]
raghavgururajan has joined #lisp
FreeBirdLjj has quit [Ping timeout: 250 seconds]
raghavgururajan has quit [Remote host closed the connection]
frgo has joined #lisp
jonatack has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
rgherdt has joined #lisp
ir0nbutt has quit [Remote host closed the connection]
kajo has joined #lisp
Cymew has quit [Quit: Konversation terminated!]
smazga has joined #lisp
Necktwi has joined #lisp
Lycurgus has quit [Remote host closed the connection]
btbvoy has joined #lisp
ralt has joined #lisp
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
Prefab has joined #lisp
Prefab has left #lisp [#lisp]
payphone` has joined #lisp
btbvoy has quit [Quit: Textual IRC Client: www.textualapp.com]
JohnMS_WORK has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
rotucer has quit [Ping timeout: 265 seconds]
cosimone has joined #lisp
frgo has quit [Remote host closed the connection]
scymtym has joined #lisp
bitmapper has joined #lisp
rotucer has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
jackdaniel has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
frgo has joined #lisp
frgo has quit [Ping timeout: 246 seconds]
dale_ has joined #lisp
dale_ is now known as dale
dddddd has quit [Ping timeout: 268 seconds]
yoeljacobsen has joined #lisp
enrioog has quit [Ping timeout: 268 seconds]
dddddd has joined #lisp
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 268 seconds]
X-Scale` is now known as X-Scale
makomo has joined #lisp
yoeljacobsen has quit [Ping timeout: 240 seconds]
slyrus_ has joined #lisp
slyrus__ has quit [Ping timeout: 252 seconds]
kritixilithos has quit [Quit: quit]
Josh_2 has joined #lisp
enrio has joined #lisp
makomo has quit [Quit: WeeChat 2.4]
efm has quit [Remote host closed the connection]
efm has joined #lisp
davepdot_ has quit [Remote host closed the connection]
hhdave has quit [Quit: hhdave]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
flamebeard has quit []
khisanth__ has quit [Ping timeout: 250 seconds]
shka_ has joined #lisp
scymtym has quit [Ping timeout: 240 seconds]
v88m has quit [Ping timeout: 265 seconds]
jackdaniel has joined #lisp
madmonkey has joined #lisp
slyrus__ has joined #lisp
remexre_ has quit [Ping timeout: 252 seconds]
slyrus_ has quit [Ping timeout: 240 seconds]
jackdaniel has quit [Read error: Connection reset by peer]
yoeljacobsen has joined #lisp
dyelar has quit [Quit: Leaving.]
efm has quit [Ping timeout: 268 seconds]
khisanth__ has joined #lisp
yoeljacobsen has quit [Client Quit]
efm has joined #lisp
hiroaki has joined #lisp
jackdaniel has joined #lisp
malfort has quit [Ping timeout: 240 seconds]
oni-on-ion has quit [Ping timeout: 250 seconds]
oni-on-ion has joined #lisp
orivej has joined #lisp
rippa has joined #lisp
clothespin has joined #lisp
test1600 has joined #lisp
remexre has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
jackdaniel has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
bitmapper has quit [Remote host closed the connection]
v88m has joined #lisp
zmt00 has quit [Quit: Leaving]
jackdaniel has joined #lisp
<pjb> beach: If I understand correctly, environments share packages (interned symbols, exported symbols, package use lists, etc), but don't share (list-all-packages) and don't share [fpm]bindings. It may be a little strange. Assuming package named "FOO" exists in the environment, (find-package (package-name (first (package-use-list (find-package "FOO"))))) could return NIL (if the first package used by "FOO" is not in the current
<pjb> environment). Since (first (package-use-list (find-package "FOO"))) is not deleted, how do we justify that?
cosimone has quit [Quit: Quit.]
<pjb> Similarly, it may be strange to have symbols interned/exported while not belonging to the current "API", with no [fpm]binding.
bjorkintosh has quit [Remote host closed the connection]
bjorkintosh has joined #lisp
zmt00 has joined #lisp
parjanya has joined #lisp
<pjb> On the other hand, anything that is shared between environment, is part of the communication system between environments. Since packages and symbols are values, there's not reason to exclude them from being shared. Bindings are not first class objects, so they can be excluded from the communication system/sharing between environments.
test1600 has quit [Quit: Leaving]
<pjb> But I would say that it would be good practice to avoid sharing packages and symbols between environments (when they have different bindings).
<pjb> It would be better to make new packages, with new symbols for each environment.
enrio has quit [Ping timeout: 246 seconds]
buffergn0me has joined #lisp
enrio has joined #lisp
rotucer has quit [Ping timeout: 240 seconds]
v88m has quit [Ping timeout: 250 seconds]
jackdaniel has quit [Read error: Connection reset by peer]
jackdaniel2 has joined #lisp
jackdaniel2 has quit [Read error: Connection reset by peer]
clothespin has quit [Ping timeout: 250 seconds]
<beach> pjb: It is no stranger than the relation between FIND-CLASS and CLASS-NAME.
<beach> I have not figured out best practice yet. I am not smart enough to try to figure that stuff out in advance. I need to wait until have an existing system to try out.
<beach> Anyway, I'm off to spend time with my (admittedly small) family.
davepdotorg has joined #lisp
davepdotorg has quit [Ping timeout: 240 seconds]
v88m has joined #lisp
ggole has quit [Quit: Leaving]
bitmapper has joined #lisp
vlatkoB has quit [Remote host closed the connection]
ljavorsk has joined #lisp
slyrus_ has joined #lisp
slyrus__ has quit [Ping timeout: 245 seconds]
efm has quit [Remote host closed the connection]
efm has joined #lisp
bitmapper has quit [Ping timeout: 268 seconds]
orivej has quit [Ping timeout: 252 seconds]
shifty has quit [Ping timeout: 268 seconds]
shifty has joined #lisp
scymtym has joined #lisp
clothespin has joined #lisp
gareppa has joined #lisp
lottaquestions has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
Achylles has quit [Remote host closed the connection]
orivej has joined #lisp
gravicappa has quit [Ping timeout: 250 seconds]
<lottaquestions> Hi all, I have a question: I am stepping through some code in which the :after function of mkinstance is run of a class. However I noticed, that the actual variable names in the :after function are not available in SLDB. Instead I see variables with the name root defaulting-temp
<lottaquestions> Just wondering what exactly is going on under the hood
frgo has joined #lisp
ljavorsk has quit [Ping timeout: 240 seconds]
<lottaquestions> A follow up question would be, how would I run expressions of interest in the :after function in SLDB, since evaluate (e) does not have access to the variable names as they appear in the original code
frgo has quit [Client Quit]
Codaraxis has quit [Ping timeout: 240 seconds]
brettgilio has joined #lisp
brown121407 has quit [Ping timeout: 245 seconds]
brown121407 has joined #lisp
jackdaniel has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
<phoe> lottaquestions: sounds like #sbcl question since it might be implementation specific
<phoe> the base question would be to try and attempt the same thing with SBCL's native stepper
rotucer has joined #lisp
cosimone has joined #lisp
jackdaniel has joined #lisp
payphone` has quit [Ping timeout: 265 seconds]
jackdaniel has quit [Read error: Connection reset by peer]
slyrus__ has joined #lisp
malfort has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
slyrus_ has quit [Ping timeout: 268 seconds]
bjorkint0sh has joined #lisp
jfb4_ has joined #lisp
brown121408 has joined #lisp
brown121407 has quit [Read error: Connection reset by peer]
bjorkintosh has quit [Ping timeout: 250 seconds]
jfb4 has quit [Ping timeout: 240 seconds]
ntsrth^ has joined #lisp
gravicappa has joined #lisp
jfb4_ has quit [Ping timeout: 245 seconds]
jfb4 has joined #lisp
pilne has joined #lisp
jfb4 has quit [Ping timeout: 246 seconds]
amerigo has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
gareppa has quit [Quit: Leaving]
bjorkint0sh has quit [Quit: Leaving]
enrio has quit [Ping timeout: 265 seconds]
EvW1 has joined #lisp
jfb4 has joined #lisp
jfb4_ has joined #lisp
jackdaniel has joined #lisp
jfb4 has quit [Ping timeout: 250 seconds]
ArthurStrong has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
shka_ has quit [Ping timeout: 265 seconds]
enrio has joined #lisp
jfb4 has joined #lisp
jfb4_ has quit [Ping timeout: 265 seconds]
enrio has quit [Ping timeout: 276 seconds]
malfort_ has joined #lisp
malfort has quit [Ping timeout: 250 seconds]
jfb4_ has joined #lisp
jfb4 has quit [Ping timeout: 250 seconds]
payphone` has joined #lisp
bitmapper has joined #lisp
loskutak has joined #lisp
buffergn0me has quit [Ping timeout: 250 seconds]
lottaquestions is now known as lottaquestions_
X-Scale has quit [Ping timeout: 250 seconds]
X-Scale` has joined #lisp
<loskutak> Hi, I would like to do something like: (setf (if t (first '(1 2 3)) (second '(1 2 3))) 4)
X-Scale` is now known as X-Scale
<loskutak> but that doesn't work - undefined function (setf if)... How to do this kind of stuff?
bitmapper has quit [Ping timeout: 250 seconds]
<pjb> then define it.
<pjb> clhs define-setf-expander
<pjb> loskutak: note: clisp has one already.
lottaquestions_ is now known as lottaquestions
<pjb> loskutak: note in anycase, note that your code is not conforming: you cannot mutate a literal!
<loskutak> I am just a beginner and this seems to be too difficult. It also seems to me that there has to be some good reason this isn't implemented already
<pjb> loskutak: You want something like: (let ((mutable-list (list 1 2 3))) (setf (if (zerop (random 2)) (first mutable-list) (second mutable-list)) 4) mutable-list)
<pjb> loskutak: you will always stay a beginner if you don't learn to use those more sophisticated operators.
<loskutak> pjb: yeah, ok - wrong example...
<pjb> loskutak: or if you don't learn to cheat and to go fetch the code you need where it already exists.
<pjb> loskutak: this is why I told you it was already in clisp!!!
<pjb> loskutak: go fetch the sources of clisp and find it.
parjanya has quit [Remote host closed the connection]
<loskutak> pjb: ok, will try that. Thanks.
<Bike> you can't define a setf expander for if, it's a standard symbol.
varjag has joined #lisp
<Bike> as for why it doesn't exist, computing the temporaries and stuff seems like it would be pretty strange. i'll check what clisp does.
<loskutak> pjb: think I have found it (define-setf-expander IF ...) is that the thing?
<Bike> that would be it, yes.
<Bike> that sublis-in-form seems sketchy.
<pjb> Bike: well, really clhs 11.1.2.1.2 forbids it because the implementation may have one defined and rely on it. But the only implementation that defines a setf-expander for cl:if is clisp, so it should just work to define one on cl:if in other implementations.
<loskutak> pjb: 'you will always stay a beginner if you don't learn to use those more sophisticated operators.' - looking at that code I think you do not understand what I mean by beginner...
<pjb> loskutak: you can put it for next year, and in the mean time, use (if test (setf (first mutable-list) new-value) (setf (second mutable-list) new-value))
<pjb> loskutak: or you can use (setf (elt mutable-list (if test 0 1)) new-value)
<nirved> there are three ways to make a new setf: define-setf-expander, defsetf, (defun (setf ...) ...)
<loskutak> I was trying to write a macro that would return either first or second element of list based on some condition and wanted this to be setf-able so that rules out the (if test ...) variant. I think I will give up - this seems to be too much exotic
<loskutak> thanks for help anyway!
malfort_ has quit [Ping timeout: 268 seconds]
<pjb> loskutak: as a beginner you should try to write it as a function instead.
<pjb> loskutak: then you can easily write (defun (setf foo) (new-value …) …) for a function (defun foo (…) …)
<pjb> (defun (setf first-or-second) (new-value list) (assert (consp (cdr list))) (if (zerop (random 2)) (setf (first list) new-value) (setf (second list) new-value)))
Josh_2 has quit [Read error: Connection reset by peer]
jackdaniel has joined #lisp
lottaquestions_ has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
<loskutak> pjb: oh now I see. I should be able to do this. Thanks!
Guest75462 has quit [Read error: Connection reset by peer]
random-nick has quit [Ping timeout: 240 seconds]
Guest75462 has joined #lisp
manjaroi3 has joined #lisp
clothespin has quit [Ping timeout: 245 seconds]
EvW1 has quit [Ping timeout: 252 seconds]
smazga has quit [Quit: leaving]
manjaroi3 has quit [Quit: leaving]
malfort has joined #lisp
brettgilio has quit [Ping timeout: 250 seconds]
varjag has quit [Ping timeout: 250 seconds]
Remavas has quit [Ping timeout: 268 seconds]
malfort has quit [Ping timeout: 268 seconds]
cosimone has quit [Remote host closed the connection]
secretmyth has joined #lisp
cosimone has joined #lisp
smokeink has joined #lisp
bitmapper has joined #lisp
slyrus__ has quit [Remote host closed the connection]
slyrus__ has joined #lisp
rgherdt has quit [Quit: Leaving]
Remavas has joined #lisp
davepdotorg has joined #lisp
Lycurgus has joined #lisp
davepdotorg has quit [Ping timeout: 265 seconds]
Remavas has quit [Ping timeout: 250 seconds]
Bike_ has joined #lisp
Bike has quit [Disconnected by services]
Bike_ is now known as Bike
bjorkintosh has joined #lisp
Remavas has joined #lisp