morganw has quit [Remote host closed the connection]
tibfulv has quit [Ping timeout: 260 seconds]
<phoe>
luis: don't worry, we have tea too
gxt has quit [Ping timeout: 255 seconds]
azimut has joined #commonlisp
thawes has joined #commonlisp
gxt has joined #commonlisp
nij- has left #commonlisp [#commonlisp]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lucerne has joined #commonlisp
tibfulv has joined #commonlisp
epony has quit [Quit: QUIT]
NotThatRPG has joined #commonlisp
dipper_ has joined #commonlisp
Catie has quit [Ping timeout: 255 seconds]
<luis>
phoe: ;)
jeosol has joined #commonlisp
Catie has joined #commonlisp
epony has joined #commonlisp
random-nick has quit [Ping timeout: 240 seconds]
thuna` has quit [Remote host closed the connection]
thuna` has joined #commonlisp
thuna` has quit [Remote host closed the connection]
thuna` has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
grawlinson has quit [Quit: SIGTERM]
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
grawlinson has joined #commonlisp
jeosol has quit [Quit: Client closed]
akoana has quit [Quit: leaving]
<shunter>
Quick question on WITH-XYZ macros that bind VAR -- is it recommended to declare that VAR has dynamic extent? VAR shouldn't be used outside the body anyways, so I think it fits with what dynamic extent is supposed to be, right?
<Bike>
depends on whether the actual value is used outside the body.
<shunter>
It shouldn't, because the meaningful resource is closed by the time execution leaves the body
<Bike>
depends on the macro.
attila_lendvai has quit [Ping timeout: 260 seconds]
<shunter>
Very much like a with-open-stream: `(let ((,var (wl-display-connect ,@args)) (unwind-protect (progn ,@body) (wl-display-close ,var)))
<Bike>
wouldn't make sense with with-slots, for example
<Bike>
if the value is actually inaccessible than using dx is fine. unless wl-display-connect inlines to something special, i doubt the declaration will really do anything, though.
<shunter>
All right, thank you
<Bike>
then*
thuna` has quit [Ping timeout: 252 seconds]
waleee has quit [Ping timeout: 255 seconds]
nij- has joined #commonlisp
karlosz has quit [Quit: karlosz]
<dbotton>
Is there any reason not to use defun in a defun?
<Bike>
it'll make your code very confusing, as it will mean calling a function alters the global definition of some other function.
causal has quit [Quit: WeeChat 3.7.1]
<dbotton>
In this case the outer function is generated and in theory never seen.
<Bike>
what calls it?
<dbotton>
First in clog lingo - When you instantiate an instance of a clog panel there is an on-setup handler, so in that handler I want to sometimes define a function. - so in CL lingo - this is a function say create-panel generated by the builder that includes code by the user to run each time create-panel is used. So wanted to understand potential pitfalls if they add a defun
<dbotton>
Adding a defun in this context is useful here
anticomputer has quit [Ping timeout: 255 seconds]
<dbotton>
As I can say have a canvas, draw a circle when created, then reuses the same code in say the on-click
<Bike>
well having code that messes with the global environment is messy for the same reason messing with the global environment usually is.
anticomputer has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<dbotton>
Was there any specific rationale for allowing defun in a defun?
notzmv has joined #commonlisp
<Bike>
rationale what, in the standard? defun is just a normal form, so there's no reason to disallow it anywhere, and no specific rationale for allowing it anywhere
<dbotton>
thank you Bike
dipper_ has quit [Remote host closed the connection]
mrcom has quit [Read error: Connection reset by peer]
mrcom has joined #commonlisp
<dbotton>
Bike, this seems interesting as a result - (defmethod draw ((obj (eql panel)) circle-color) nil) if I want a more JavaScript style of OO to place the defmethods in the create function.
<emacs-dwim>
nij-: O, I guess evalhook & applyhook were removed from the standard.
<dbotton>
that is tying the draw method directly to the instance
bilegeek has joined #commonlisp
terrorjack has quit [Ping timeout: 256 seconds]
terrorjack has joined #commonlisp
<dbotton>
panel is the instance of the defclass
emacs-dwim has left #commonlisp [ERC 5.4 (IRC client for GNU Emacs 28.2)]
emacs-dwim has joined #commonlisp
bilegeek has quit [Quit: Leaving]
bilegeek has joined #commonlisp
<nij->
emacs-dwim wow that's cool
<nij->
I guess it's removed from the standard for easier optimization?
pranavats has left #commonlisp [Error from remote client]
panji has joined #commonlisp
epony has quit [Read error: Connection reset by peer]
euandreh has quit [Ping timeout: 260 seconds]
pranavats has joined #commonlisp
Fare has quit [Ping timeout: 260 seconds]
cmack has joined #commonlisp
junkrunner has quit [Ping timeout: 248 seconds]
Lord_of_Life has quit [Ping timeout: 260 seconds]
epony has joined #commonlisp
Lord_of_Life has joined #commonlisp
Bike has quit [Quit: Lost terminal]
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
junkrunner has joined #commonlisp
<hayley>
I heard *eval-hook* was removed as it did nothing in compiled code, making it rather awkward.
<phoe>
Shinmera: yes, I am aware; I just can't do it at the moment since my will and strength are going elsewhere
pranavats has left #commonlisp [Error from remote client]
junkrunner has quit [Ping timeout: 260 seconds]
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
son0p has quit [Ping timeout: 260 seconds]
Cymew has joined #commonlisp
jes1 has quit [Ping timeout: 260 seconds]
morganw has joined #commonlisp
pranavats has joined #commonlisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
jes1 has joined #commonlisp
rainthree has joined #commonlisp
cosimone` has quit [Remote host closed the connection]
cosimone has joined #commonlisp
azimut has joined #commonlisp
Duuqnd has quit [Quit: Bridge terminating on SIGTERM]
ecocode[m] has quit [Quit: Bridge terminating on SIGTERM]
acma has quit [Quit: Bridge terminating on SIGTERM]
infra_red[m] has quit [Quit: Bridge terminating on SIGTERM]
kakuhen has quit [Quit: Bridge terminating on SIGTERM]
hayley has quit [Quit: Bridge terminating on SIGTERM]
cel7t has quit [Quit: Bridge terminating on SIGTERM]
char[m] has quit [Quit: Bridge terminating on SIGTERM]
cosimone has quit [Read error: Connection reset by peer]
dieggsy has quit [Quit: Bridge terminating on SIGTERM]
AadVersteden[m] has quit [Quit: Bridge terminating on SIGTERM]
sp has quit [Quit: Bridge terminating on SIGTERM]
yitzi has quit [Quit: Bridge terminating on SIGTERM]
Gnuxie has quit [Quit: Bridge terminating on SIGTERM]
bitspook[m] has quit [Quit: Bridge terminating on SIGTERM]
get_in_the_fucki has quit [Quit: Bridge terminating on SIGTERM]
nicm[m] has quit [Quit: Bridge terminating on SIGTERM]
tiziodcaio has quit [Quit: Bridge terminating on SIGTERM]
loke[m] has quit [Quit: Bridge terminating on SIGTERM]
ilmu[m] has quit [Quit: Bridge terminating on SIGTERM]
torhex-pasmul[m] has quit [Quit: Bridge terminating on SIGTERM]
Helmholtz has quit [Quit: Bridge terminating on SIGTERM]
Mrtn[m] has quit [Quit: Bridge terminating on SIGTERM]
Mrtn[m] has joined #commonlisp
Josh_2 has quit [Remote host closed the connection]
scymtym has joined #commonlisp
<pjb>
pve: "whereas nreverse might modify and return the given sequence." "For nreverse, if sequence is a vector, the result is a vector that has the same actual array element type as sequence." "For nreverse, sequence might be destroyed and re-used to produce the result. The result might or might not be identical to sequence." " When sequence is a vector, nreverse is permitted to re-order the elements of sequence in order to produce the
<pjb>
resulting vector."
<pjb>
"nreverse might either create a new sequence, modify the argument sequence, or both."
<pjb>
pve: so the specifications is rather clear, explicit and even redundant on that point.
<pjb>
pve: you can do: (let ((r (nreverse v))) (unless (eql r v) (replace v r))) to reverse the fill-pointed vector in-place.
tiziodcaio has joined #commonlisp
Gnuxie has joined #commonlisp
yitzi has joined #commonlisp
kakuhen has joined #commonlisp
ecocode[m] has joined #commonlisp
char[m] has joined #commonlisp
nicm[m] has joined #commonlisp
<pjb>
shunter: a typical case, is (with-input-from-string (*standard-input* "foo") (read)) or (with-output-to-string (*standard-output*) (print 'hi))
sp has joined #commonlisp
AadVersteden[m] has joined #commonlisp
Duuqnd has joined #commonlisp
loke[m] has joined #commonlisp
acma has joined #commonlisp
ilmu[m] has joined #commonlisp
Helmholtz has joined #commonlisp
torhex-pasmul[m] has joined #commonlisp
infra_red[m] has joined #commonlisp
dieggsy has joined #commonlisp
Bung has joined #commonlisp
<pjb>
shunter: the macro should let the user declare the variable special if wanted, but by default, it should be lexical binding.
cel7t has joined #commonlisp
bitspook[m] has joined #commonlisp
get_in_the_fucki has joined #commonlisp
hayley has joined #commonlisp
cosimone has joined #commonlisp
Bung has quit [Quit: Leaving]
<pve>
pjb: thanks, I don't think I've ever used replace before
<phoe>
pjb: tiny nitpick, (let ... (unless ...) v) to not discard the value of nreverse
son0p has joined #commonlisp
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
rainthree has quit [Ping timeout: 248 seconds]
rainthree has joined #commonlisp
random-nick has joined #commonlisp
Bung has joined #commonlisp
Fare has quit [Ping timeout: 240 seconds]
Bung has quit [Remote host closed the connection]
Bung has joined #commonlisp
<_death>
although NREVERSE entry hints at what it's permitted to do to a vector, I'm not sure it's ok to assume that you can pass it (after destruction) to REPLACE as a target, if NREVERSE did not return it.. in any case seems bad style
<_death>
if you must have it in-place, probably best to write your own inplace-reverse
azimut has joined #commonlisp
Bung has joined #commonlisp
Bung has quit [Remote host closed the connection]
Bung has joined #commonlisp
nij- has joined #commonlisp
Fare has joined #commonlisp
jmdaemon has quit [Ping timeout: 260 seconds]
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
genpaku has quit [Read error: Connection reset by peer]
genpaku has joined #commonlisp
<Nilby>
I'm pretty sure one can make an extensible sequence in sbcl which would violate the assumption that nreverse returns the original.
<phoe>
yeah, just defmethod it to call reverse
<_death>
stumbled on 3 annoying things related to arrays today :/
mmontone has joined #commonlisp
mmontone has quit [Client Quit]
Bung has quit [Write error: Connection reset by peer]
ec has quit [Write error: Connection reset by peer]
Bung has joined #commonlisp
Bung has quit [Remote host closed the connection]
Bung has joined #commonlisp
ec has joined #commonlisp
Bung has quit [Remote host closed the connection]
Bung has joined #commonlisp
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
<phoe>
hm?
<_death>
good, you took the bait :)... we can start with make-array's :initial-contents parameter... it can't take multidimensional arrays
<Nilby>
let's pretend this is safe space to talk about how bad arrays are :)
Bike has joined #commonlisp
<_death>
second, (coerce (make-array '(3 3) :element-type 'single-float :initial-element 1.0) '(simple-array t (3 3))) fails though the single dimension case is ok
<Nilby>
:initial-contents is perplexing. I feel like what's the point if you have to make it be a list?
gxt has quit [Ping timeout: 255 seconds]
<_death>
third, there's no standard readable printed representation for specialized arrays (other than strings and bit-vectors).. so if you print them readably, an implementation can signal an error or use nonportable syntax (like sbcl).. so if you wish to print some piece of code readably, you need to be aware of this pitfall and act accordingly
robin has quit [Remote host closed the connection]
robin has joined #commonlisp
<Nilby>
I agree coerce could be a lot more coercive in many cases. One might wish it was generic.
tyson2 has joined #commonlisp
<_death>
for that one can still use REPLACE and displaced arrays.. REPLACE is very useful
Fare has quit [Remote host closed the connection]
<Nilby>
I've too gotten bitten array (non-)readability. I sometimes feel like arrays should have more subclasses and the simple ones should always work, for things like coercion and readability.
gxt has joined #commonlisp
<_death>
trivial-print-read :D
<Nilby>
displaced arrays are sometimes troubling, but I still like them. I feel like for things that could prove it okay, a displaced-subseq could make a lot of things quicker.
<jackdaniel>
conformal displacement is the feature I miss in CL ;p
<_death>
in code that cares about performance, though, I often need simple arrays and displaced arrays become much less useful
<_death>
does ecl implement it?
<_death>
(conformal arrays)
<emacs-dwim>
_death: sbcl's printed arrays are portable readable though, just not portably printable?
<jackdaniel>
_death: no (yet?)
anticomputer has quit [Remote host closed the connection]
<Nilby>
yep, a history of repl values isn't even portable
<jackdaniel>
Nilby: what do you mean?
<_death>
where is sexp-dribble
<Nilby>
just the basic serialization problem. if you print values and try to re-read them, in a different impl, but of course even a different image
<Nilby>
oh, i forgot ya'll use emacs which can do it but treats it like strings
<jackdaniel>
ah, I see - so its about reader/writer; I thought that something repl specific and I couldn't think what (admittedly repl is haf about read and print)
<phoe>
a single #< is unreadable even across a single impl, too
<jackdaniel>
#< enables a secret language that common lisp doesn't understand - it's just in case when it revolts
<jackdaniel>
for when*
<_death>
#<ZALGO>
anticomputer has quit [Remote host closed the connection]
<Nilby>
I feel like a lot of these problems could potentially be solved by more CLOSification of the built-in things
anticomputer has joined #commonlisp
<jackdaniel>
you may have hash-table as a standard class, but how do you serialize it? it is not that hash table maintains an assoc list
<jackdaniel>
you'd need to come up with a readable representation for hashes
<jackdaniel>
(and other things)
<_death>
defstruct all things.. it already has read syntax :)
<Nilby>
one could define printable equality as constructor args being printably equal
<Nilby>
i'd be okay with a fuzzy readability of make-undreadable-object
molson has quit [Ping timeout: 256 seconds]
Bung has quit [Remote host closed the connection]
Bung has joined #commonlisp
molson has joined #commonlisp
<emacs-dwim>
Is there a library for introducing extended-lambda-list-keywords?
<phoe>
introducing them where exactly
<phoe>
you can always write a custom macro and have custom lambda lists in it, you don't really need a library for that
Bung has quit [Remote host closed the connection]
<phoe>
as for existing lambda lists defined by the specification, there's no way to extend them and you'll have to modify your implementation in order to support them
<emacs-dwim>
define-let+-expansion for defmacro lambda-list-keywords
<phoe>
emacs-dwim: what is define-let+-expansion
<emacs-dwim>
let+ combines several binding forms, multiple-values. It's user-extensible. So I added ppcre & trivia to it for example. I want to write defmacros that &match trivia patterns and bind them.
<phoe>
ask the authors of let+ for that
<phoe>
it's not a standard CL construct, it's a library of some sort
<beach>
emacs-dwim: The current idea with some of us is that the s-expression-syntax library provides parsers for various standard expressions. And it should be possible to define custom parsers for extended lambda lists.
<phoe>
as for the lambda list in DEFMACRO, there is no portable way to extend its lambda list other than supplying your own variant of DEFMACRO that can do this.
<beach>
emacs-dwim: It is tricky stuff because custom lambda-list keywords must also come with a description that says where they can appear, if and how many arguments they take, if they can appear several times, etc.
jeosol has joined #commonlisp
<emacs-dwim>
I'll try using s-expression-syntax defining my defmacro+.
<beach>
emacs-dwim: It is not quite ready for widespread use, so you might run into some issues. But it would be good to start experimenting with it.
Bung has joined #commonlisp
nij- has joined #commonlisp
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
nij- has quit [Ping timeout: 252 seconds]
Bunggg has joined #commonlisp
Bung has quit [Remote host closed the connection]
nij- has joined #commonlisp
<nij->
Is there a way to list all global variables at the top level in the repl?
<random-nick>
you could iterate through packages and check if their symbols are bound
<beach>
You can use DO-ALL-SYMBOLS and filter by which ones are BOUNDP.
rogersm has quit [Quit: Leaving...]
<Shinmera>
(apropos "")
waleee has joined #commonlisp
Algernon69 has joined #commonlisp
Algernon69 has quit [Client Quit]
<beach>
nij-: Of course, you are somewhat out of luck, because BOUNDP doesn't really tell you what you want. There is some annoyingly ambiguous language in the standard. Sometimes "bound" means "has a value", and sometimes it means "has a binding that may have no value".
<beach>
<beach>
Like if you do (DEFVAR XYZ) and then (BOUNDP 'XYZ) you get NIL. Yet, XYZ is a variable.
jmes has joined #commonlisp
<nij->
hmm
<emacs-dwim>
What about: (cltl2:variable-information symbol) ?
<_death>
then there's sb-cltl2:variable-information.. but then there's sb-ext:defglobal
<jmes>
Is there a way to shadow a binding with a symbol-macro whose expansion references the original binding? e.g. this is what I want to do, but it exhausts the control stack: (let ((a 1)) (symbol-macrolet ((a (1+ a))) ...))
<White_Flame>
a really silly way is to do packagename:<tab> and see everything that is earmuffed with asterisks :-P
<White_Flame>
^ nij-
<beach>
jmes: Use a package marker for the original symbol.
<beach>
Oh, shadow as in lexical shadowing. No, I don't think so.
<Shinmera>
(definitions:find-definitions *package* :type 'definitions:special-variable) will give you whatever variables are accessible in the current package.
<Shinmera>
and this is *actual variables* not just ones that are bound, as beach points out.
<beach>
jmes: How about something like (let ((a 1)) (symbol-macrolet ((mumble a)) (symbol-macrolet ((a (1+ mumble))))))
sedzcat has joined #commonlisp
<beach>
Nah, I guess that won't work. Sorry.
<nij->
definitions is good! I will use that.
<Shinmera>
Happy to have another customer.
<jmes>
beach: Haha, no problem I was just testing it to find out the same result.
<random-nick>
is the binding lexical or dynamic?
<random-nick>
if it's dynamic you can use the quoted name with symbol-value
<jmes>
It's regular lexical binding via let in this case
ec has quit [Remote host closed the connection]
<Bike>
symbol macros just expand in the same context, so if the original variable appears in the expansion it will just be expanded again
<Bike>
i don't think there's any way to make a macro that expands exactly once
Bunggg is now known as Bung
ec has joined #commonlisp
<jmes>
Bike: yeah, so what I've learned is if a symbol-macro expansion has its own symbol inside it then the stack goes boom, sadly.
azimut has quit [Ping timeout: 255 seconds]
azimut has joined #commonlisp
notzmv has quit [Remote host closed the connection]
karlosz has joined #commonlisp
epony has quit [Ping timeout: 268 seconds]
<Bike>
of course, for something like 1+ there's no need to refer to the actual binding, so (let ((mumble a)) (symbol-macrolet ((a (1+ mumble))) ...)) would work, but maybe you want it as an actual place
seletz has quit [Ping timeout: 252 seconds]
lucerne has joined #commonlisp
nij- has quit [Read error: Connection reset by peer]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
azimut has quit [Remote host closed the connection]