frgo has quit [Read error: Connection reset by peer]
karlosz has quit [Ping timeout: 256 seconds]
<yottabyte>
wow.
jstoddard has quit [Ping timeout: 240 seconds]
jeosol has joined #commonlisp
frgo has joined #commonlisp
Bike has quit [Quit: Connection closed]
frgo has quit [Ping timeout: 240 seconds]
gaqwas has quit [Remote host closed the connection]
frgo has joined #commonlisp
frgo has quit [Ping timeout: 250 seconds]
frgo has joined #commonlisp
frgo has quit [Ping timeout: 240 seconds]
frgo has joined #commonlisp
frgo has quit [Ping timeout: 240 seconds]
notzmv has joined #commonlisp
monaaraj has quit [Ping timeout: 240 seconds]
gaqwas has joined #commonlisp
monaaraj has joined #commonlisp
gaqwas has quit [Ping timeout: 240 seconds]
skeemer has quit [Quit: Leaving]
Bike has joined #commonlisp
s-liao has joined #commonlisp
Krystof has quit [Ping timeout: 240 seconds]
paul0 has quit [Quit: Leaving]
thomp has joined #commonlisp
xsperry has joined #commonlisp
molson_ has joined #commonlisp
<yottabyte>
In slime, the current directory is set to whatever buffer I started slime in. As I open new files in different directories, slime remains open and still pointed to that other directory, even if I close the original file. How do I change it to the current file's directory? Close and restart slime?
molson has quit [Ping timeout: 240 seconds]
<Catie>
With no input on the repl, type ",cd"
<sveit_>
in SBCL, would (labels ((f (x) (+ x 1)) (g (x) (+ (f x) 1))) (declare (inline f g)) (g x)) inline the definitions of /both/ g and f into the call?
<sveit_>
and if i instead put (declare (inline f)) (without g) would f be inlined into the definition of g?
morganw has quit [Remote host closed the connection]
molson_ has quit [Remote host closed the connection]
thomaslewis has joined #commonlisp
jstoddard has joined #commonlisp
biog has quit [Quit: ZZZzzz…]
thomaslewis has left #commonlisp [#commonlisp]
thomp has quit [Ping timeout: 250 seconds]
<_death>
you can use DISASSEMBLE to find out
biog has joined #commonlisp
<sveit_>
thanks! another question: is there a simple way to make macros "fall back", in the sense that (macrolet ((a (b) (if (eq b 'b) ''nice ''not-nice))) (macrolet ((a (b) (if (eq b 'a) 'nicest (SOMEHOW EXPAND A)))) (a 'b))) macroexpands to 'nice?
<sveit_>
in my placeholder (SOMEHOW EXPAND A), (a b) will not work, or would `(a ,b)
<sveit_>
well actually (a b) would work, but by accident. had i called the argument to a, c, it would not work
waleee has quit [Ping timeout: 240 seconds]
molson has joined #commonlisp
molson has quit [Remote host closed the connection]
<Bike>
no, you shadow the macro
<_death>
not sure if there's a standard way.. a non-portable one is (macrolet ((a (b) (if (eq b 'b) ''nice ''not-nice))) (macrolet ((a (c &environment env) (if (eq c 'a) ''nicest (macroexpand `(a ,c) (sb-c::lexenv-parent env))))) (a b)))
random-nick has quit [Ping timeout: 250 seconds]
molson has joined #commonlisp
biog has quit [Quit: ZZZzzz…]
molson_ has joined #commonlisp
molson_ has quit [Client Quit]
molson_ has joined #commonlisp
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
s-liao has quit [Quit: Ping timeout (120 seconds)]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
Colleen has quit [Quit: Colleen]
Colleen has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
<bollu>
Why do we have two types of quotations? '(1 2 3) and `(1 2 3)? From what I can tell, unquoting (,x) is only allowed within a backquote (`) and not within regular quotes ('). I Why does just backquotes not suffice?
<moon-child>
bollu: one example is: `',x
<moon-child>
bollu: QUOTE came first, and is a basic language feature
<jackdaniel>
backquote is meant for templating and it is used by the reader; quote is a special form (quote foo) and it prevents evaluation
<moon-child>
bollu: quasiquote and unquote is a utility feature
<jackdaniel>
these are two different things with somewhat overlapping scope of being useful
<bollu>
can one implement one in terms of the other? Or are they both primitives?
<moon-child>
jackdaniel: technically quote is a special _operator_, and it is (quote foo) that is a special form :)
<bollu>
:)
<moon-child>
bollu: it is easy to implement ` and , yourself. Try it
<_death>
well, ` is not so easy..
<beach>
Not so easy indeed.
<_death>
' is easy though
<moon-child>
it isn't?
<jackdaniel>
they should be treated as orthogonal features acting on a different level of abstraction
<beach>
bollu: The reader macro for ` creates a macro form and not a special form.
<_death>
moon-child: did you try it?
<moon-child>
there's a paper on the topic that iirc constructs something useful (though without nesting) in a page or so of code
<moon-child>
err, sorry
<_death>
there's a cltl2 appendix
<moon-child>
with nesting, without optimization
<jackdaniel>
beach: what do you mean by that it creates a macro form?
<beach>
jackdaniel: Something like (quasiquote ...)
biog has joined #commonlisp
<beach>
I guess "macro call" is the right term.
<jackdaniel>
does the standard say that it creates such a thing? (putting aside cltl2 appendix that provides example implementation that does that)
<beach>
Let me look it up.
<beach>
jackdaniel: It was a pedagogical approximation.
<moon-child>
'An implementation is free to interpret a backquoted form F1 as any form F2 that, when evaluated, will produce a result that is the same under equal as the result implied by the above definition, provided that the side-effect behavior of the substitute form F2 is also consistent with the description given above'
<jackdaniel>
beach: I see.
<_death>
note that `#(foo ,x) should also work btw
<beach>
jackdaniel: It was a way of answering the question "Or are they both primitives?" by giving some better terminology.
<jackdaniel>
I had quite a headache persuading someone in the past that the implementation is not obligated to create an intermediate form
<beach>
jackdaniel: That I can understand. The reader macro would be fairly complicated then.
tyson2 has joined #commonlisp
<jackdaniel>
the reader macro would be fairly complicated when it uses or when it doesn't use the intermediate macro form?
<beach>
jackdaniel: The latter. In the first case, it is straightforward. The complication is then in the macro definition of the macro call that it generates.
<phantomics>
Could someone remind me of the repository that has the suggested CL standard additions?
<moon-child>
wscl?
<jackdaniel>
I see. fwiw SBCL uses an intermediate form (after cltl2 appendix) while ECL doesn't
<jackdaniel>
I don't know about other implementations
<beach>
phantomics: WSCL is not for additions to the standard. It is for specifying currently unspecified behavior in a way that is consistent with what major implementations already do.
<phantomics>
Ok, that's it, I saw it before but didn't look in the passed folder, thanks
<phantomics>
beach: makes sense
<pjb>
bollu: you don't need quote either. Instead of writing (list 'a 'b 'c) you can write (list (intern "A") (intern "B") (intern "C")).
<beach>
phantomics: There is not much that the community would agree upon in terms of suggested additions, so WSCL is meant to be nearly completely uncontroversial.
<moon-child>
pjb: it gets complicated. You must maintain read-time structure-sharing
<beach>
With #= and ##?
<_death>
moon-child: nice, I should read it sometime.. however, even short papers (and code) can take nontrivial time and effort to implement
<moon-child>
pjb: (let ((x '#1=(2)) (y '#1#)) (eq x y)) how do you ensure this is t?
<moon-child>
beach: yes
<phantomics>
beach: right, the addition I'm proposing will address the definition of an alphanumeric character, which is currently somewhat inconsistent
<pjb>
moon-child: (let ((l2 (list 2))) (let ((x l2) (y l2)) (eq x y))) #| --> t |#
<moon-child>
pjb: right. But that is a global transformation
<moon-child>
and I expect even that can not be made to work in the presence of EVAL
<_death>
that only works because strings are self quoting ;)
<moon-child>
_death: objects of most types are self-evaluating
<_death>
indeed
<moon-child>
the notable exceptions are symbols and lists
<semz>
the only exceptions, no?
<moon-child>
so I do not find fault with that part, unless you limit yourself to _only_ symbols and lists
treflip has quit [Remote host closed the connection]
foxfromabyss has joined #commonlisp
<foxfromabyss>
hi! I have two questions.
<foxfromabyss>
1) is it possible to extend existing methods(?), such as `+` or `eq` for new classes, without jumping through too many hoops?
<foxfromabyss>
2) let's say I have 2 classes. Class A and Class B. Class B has a field with value of Class A. I have written a comparator for Class A. Is it possible to piggyback on that comparator for `sort`?
<moon-child>
regarding 1, no, but see cl-generic
<moon-child>
I do not recommend extending EQ; consider EQUAL instead
<moon-child>
for 2, something like :key #'get-a should do what you want
<phoe>
either :key or :test or both
karlosz has quit [Ping timeout: 250 seconds]
<phoe>
(defclass a () (...)) (defclass b () ((a :accessor b-a)))
<foxfromabyss>
so `:test` gets applied to `:key` actually?
<moon-child>
yes
<phoe>
then (sort list-of-b-instances :key #'b-a :test #'a<)
tyson2 has quit [Remote host closed the connection]
<phoe>
woops, sorry
<foxfromabyss>
thanks :) Sorry if the questions were dumb :D
<phoe>
then (sort list-of-b-instances #'a< :key #'b-a)
<phoe>
and no problem
<moon-child>
morally, f :key g is the same as (lambda (x y) (f (g x) (g y)))
<pjb>
foxfromabyss: yes: (shadow '+) (defgeneric + (a b)) (defmethod + (a b) (cl:+ a b )) (defmethod + ((a string) (b string)) (+ (parse-integer a) (parse-integer b)))
<moon-child>
but it is convenient to avoid typing g twice
<foxfromabyss>
i am scared of shadowing
<foxfromabyss>
:(
<pjb>
foxfromabyss: yes, sort takes a less argument.
<foxfromabyss>
thanks a lot for all the answers, appreciate it very much
<pjb>
foxfromabyss: so you're scared of too many hoops, of shadowing, and what else?
<foxfromabyss>
too many hoops is just me being lazy, and shadowing feels like smth that would break a lot of stuff, but maybe not
Lord_Nightmare has quit [Ping timeout: 240 seconds]
<foxfromabyss>
*could break a lot of stuff
<foxfromabyss>
unrelated, is there an example somewhere of how people use SLIME/SLY? So far i've been just pasting stuff from the source file and testing it there, but it feels like I am underutilizing a lot of features
<foxfromabyss>
but i am not sure what i could even need
<pjb>
foxfromabyss: you can avoid shadowing, by using symbols with a different name: (defgeneric plus (a b)) …
<contrapunctus>
(Mine is in a Hydra, so `m e e`, or sometimes I use `lispy-eval` (just `e`))
gaqwas has joined #commonlisp
<frodef>
Hi all, is there some package that provides a compatibility layer for the MOP? Such that I can call e.g. sb-mop:class-slots without relying explicitly on sbcl/sb-mop ?
<phoe>
closer-mop
<frodef>
phoe: thanks
<phoe>
(ql:quickload :closer-mop) and then (:use #:c2cl) instead of #:cl
<phoe>
or just #'c2mop:class-slots
<jackdaniel>
c2cl supplements implementation-specified operators like defmethod with wrappers when the implementation doesn't implement fully the mop protocol and that can be fixed with a wrapper
<frodef>
I see
<foxfromabyss>
i see, thanks! (for both shadowing and SLIME :) )
karlosz has joined #commonlisp
biog has quit [Quit: ZZZzzz…]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
mgl has quit [Ping timeout: 256 seconds]
masinter has left #commonlisp [#commonlisp]
rogersm has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<moon-child>
huh, apparently at one point read-time eval was #,
<moon-child>
that is cute
<moon-child>
(analogous to regular ,)
<_death>
no, it was for load-time evaluation
<moon-child>
ah!
<_death>
"let me tell you a story, from back when #* was #" and compile-file was comfile..."
Lord_Nightmare has quit [Ping timeout: 240 seconds]
Lord_Nightmare has joined #commonlisp
attila_lendvai has quit [Ping timeout: 250 seconds]
jstoddard has quit [Ping timeout: 240 seconds]
rogersm has quit [Quit: Leaving...]
gaqwas has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
karlosz has quit [Quit: karlosz]
aartaka has quit [Ping timeout: 250 seconds]
karlosz has joined #commonlisp
akoana has joined #commonlisp
thomp has joined #commonlisp
foxfromabyss has quit [Ping timeout: 256 seconds]
thomaslewis has joined #commonlisp
<yottabyte>
why would one use flat instead of let? you can define functions (lambdas) with let, no?
<semz>
If you define a function with (let ((f (lambda ...))) ...) you have to call it with (funcall f ...) rather than being able to use (f ...)
<thomp>
Two different namespaces...
thomaslewis has left #commonlisp [#commonlisp]
<yottabyte>
gotcha
gaqwas has joined #commonlisp
john__ has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
dre has joined #commonlisp
john__ has quit [Quit: Leaving]
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
gaqwas has quit [Remote host closed the connection]
Lord_Nightmare has quit [Read error: Connection reset by peer]
Lord_Nightmare has joined #commonlisp
Common-Lisp has joined #commonlisp
occ has quit [Ping timeout: 256 seconds]
rgherdt has quit [Ping timeout: 240 seconds]
kevingal has quit [Remote host closed the connection]