<mfiano2>
Does Pascal Costanza have an alias on #lisp?
davisr has joined #lisp
khisanth_ has quit [Ping timeout: 246 seconds]
khisanth_ has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
_jrjsmrtn has joined #lisp
Fare has joined #lisp
Hofpfister has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 252 seconds]
Hofpfister has quit [Ping timeout: 264 seconds]
patlv has joined #lisp
<ebrasca>
What is "PLNs" ?
<Bike>
package local nicknames
bitmapper has quit [Ping timeout: 240 seconds]
Josh_2 has joined #lisp
lxbarbosa has quit [Remote host closed the connection]
patlv has quit [Remote host closed the connection]
reppie is now known as x[LGWs4x4i]uG2N0
hdasch has quit [Ping timeout: 250 seconds]
hdasch has joined #lisp
dale has quit [Ping timeout: 268 seconds]
dale has joined #lisp
libertyprime has joined #lisp
smazga has joined #lisp
semz has quit [Ping timeout: 245 seconds]
techquila has joined #lisp
mindthelion has quit [Ping timeout: 252 seconds]
smazga has quit [Ping timeout: 252 seconds]
Oladon has quit [Quit: Leaving.]
semz has joined #lisp
semz has quit [Changing host]
semz has joined #lisp
Fare has quit [Ping timeout: 268 seconds]
mindthelion has joined #lisp
techquila has quit [Ping timeout: 268 seconds]
Fare has joined #lisp
orivej has joined #lisp
Fare has quit [Ping timeout: 240 seconds]
ahungry has joined #lisp
Fare has joined #lisp
EvW has joined #lisp
Fare has quit [Ping timeout: 276 seconds]
Codaraxis has quit [Ping timeout: 265 seconds]
toorevitimirp has joined #lisp
Fare has joined #lisp
Hofpfister has joined #lisp
Codaraxis has joined #lisp
techquila has joined #lisp
lxbarbosa has joined #lisp
Hofpfister has quit [Ping timeout: 240 seconds]
mindthelion has quit [Ping timeout: 268 seconds]
abhixec has quit [Remote host closed the connection]
Codaraxis has quit [Read error: Connection reset by peer]
Codaraxis has joined #lisp
Oladon has joined #lisp
Bike has quit [Quit: Lost terminal]
EvW has quit [Ping timeout: 264 seconds]
toorevitimirp has quit [Read error: Connection reset by peer]
toorevitimirp has joined #lisp
Codaraxis has quit [Remote host closed the connection]
Codaraxis has joined #lisp
sellout- has quit [Quit: Leaving.]
toorevitimirp has quit [Ping timeout: 276 seconds]
toorevitimirp has joined #lisp
uranther has quit []
toorevitimirp has quit [Ping timeout: 264 seconds]
smazga has joined #lisp
ebrasca has quit [Read error: Connection reset by peer]
ebrasca` has joined #lisp
ebrasca` is now known as ebrasca
smazga has quit [Ping timeout: 268 seconds]
ebzzry has quit [Ping timeout: 240 seconds]
akoana has left #lisp ["Leaving"]
smazga has joined #lisp
superkumasan has quit [Ping timeout: 268 seconds]
raghavgururajan has joined #lisp
smazga has quit [Ping timeout: 276 seconds]
retropikzel has joined #lisp
space_otter has joined #lisp
Codaraxis has quit [Read error: Connection reset by peer]
Codaraxis has joined #lisp
Codaraxis has quit [Read error: Connection reset by peer]
Codaraxis has joined #lisp
karlosz has joined #lisp
retropikzel has quit [Remote host closed the connection]
<no-defun-allowed>
What's the opposite of find-foo (other than (setf find-foo))?
<beach>
Good morning everyone!
<ebrasca>
Morning beach!
<no-defun-allowed>
get-foo/put-foo or get-foo/set-foo are also options, I suppose.
froggey has quit [Ping timeout: 245 seconds]
vlatkoB has joined #lisp
froggey has joined #lisp
libertyprime has quit [Ping timeout: 240 seconds]
<fiddlerwoaroof>
morning beach
shka_ has joined #lisp
gravicappa has joined #lisp
<beach>
I started reading my recently acquired copy of "Object-Oriented Programming: The CLOS Perspective", and in the first chapter, the author says that DEFMETHOD was supposed to be the main operator for defining generic functions, and that DEFGENERIC was meant to be used only when the method combination or the argument-precedence order needed to be altered.
<beach>
I think this idea shows the age of CLOS. At the time, we were not so concerned about catching errors early. We allowed for SETQ on a non-existing variable to create one too.
<beach>
The problem of the idea in the book is that a minor typo on the name of a method will not be noticed.
<beach>
Apparently, SBCL used to give a warning when a a generic function was implicitly defined as a result of a DEFMETHOD form, but that is no longer the case. I think a warning is a very good idea in this case.
<beach>
In fact, I plan to always supply a DEFGENERIC form in my code. Even just to get a decent name of the parameters when the signature is shown in some IDE is a good idea to supply it.
dale has quit [Quit: My computer has gone to sleep]
sauvin has joined #lisp
<beach>
So my plan is to do it even for simple slot accessors.
<beach>
Sadly, SBCL no longer warns, so I am not informed when I forgot to supply the DEFGENERIC form.
Fare has quit [Ping timeout: 268 seconds]
<pillton>
I think ABCL does that.
<beach>
Good!
<pillton>
I now create a protocols.lisp file to contain the generic functions and any base classes. This, in conjunction with packages.lisp, provides a good overview of the system and how the objects interact.
<no-defun-allowed>
Hm, I didn't get anything at the REPL.
dddddd has quit [Read error: Connection reset by peer]
<beach>
pillton: yes, that's a very good idea. I have called it generic-functions.lisp, but your idea is more general.
<pillton>
no-defun-allowed: ABCL must have changed. I remember having to add generic functions to make it happy.
shka_ has quit [Ping timeout: 240 seconds]
<no-defun-allowed>
I do the same thing here. Explained it to my teacher when he wondered where my documentation was. (Well, that and that methods aren't owned by classes in Lisp unlike the usual OOP languages.)
<no-defun-allowed>
(A surprisingly short discussion. I just said "say DatabaseClass1 and DatabaseClass2 both have a method called get_transaction in a hypothetical Python port of my program, they should produce the same results, so duplicating documentation isn't necessary. That's why I only have documentation in my DEFGENERIC forms.")
<beach>
Nice.
<no-defun-allowed>
Yeah, it was a pleasant surprise.
<aeth>
beach: I agree. One of the reasons I use CL is because I don't need to use a linter to catch mistakes, which is a near-universal thing in dynamic languages.
<aeth>
(And the problem with that is that linters are things like that 10% that and 90% "you went 1 character over 90 characters in a line, which is unacceptable!")
<aeth>
s/like that 10%/like 10%/
<beach>
Great. So consider this to be my lobbying attempt, direct to the maintainers of our Common Lisp implementations.
<aeth>
I don't see why it can't be a compiler global variable like *foo* if it's that controversial
<beach>
I am also contemplating how to implement it in SICL. One way would be to have ADD-METHOD signal a warning before creating the generic function, but then the problem would go unnoticed forever after, once the generic-function is created.
<beach>
So I am thinking of a slot in the generic function, say IMPLICITP, so that each time a new method is added or replaced, a warning would be signaled, until the generic function has been created explicitly.
makomo has joined #lisp
Fare has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
shrdlu68 has joined #lisp
<beach>
Actually, this topic would be a good one for a lightning talk at ELS.
ltriant has quit [Quit: leaving]
Fare has quit [Ping timeout: 265 seconds]
<no-defun-allowed>
For implementors with implementations that implement the MOP, maybe an objection is better suited.
<beach>
?
<no-defun-allowed>
It was the only pun I could think of -- if the methods are standard objects.
* no-defun-allowed
cowers
ahungry has quit [Remote host closed the connection]
superkumasan has joined #lisp
smazga has joined #lisp
Codaraxis_ has joined #lisp
smazga has quit [Ping timeout: 268 seconds]
jprajzne has joined #lisp
Codaraxis has quit [Ping timeout: 240 seconds]
mingus has joined #lisp
varjag has joined #lisp
flamebeard has joined #lisp
<beach>
It's too early in the day for me to understand puns.
<no-defun-allowed>
Sorry.
slyrus has joined #lisp
varjag has quit [Ping timeout: 276 seconds]
slyrus has quit [Client Quit]
ebzzry has joined #lisp
raghavgururajan has quit [Read error: Connection reset by peer]
ljavorsk has joined #lisp
Cymew has joined #lisp
ggole has joined #lisp
space_otter_ has joined #lisp
<Ober>
cool sbcl understands the marriage operator
space_otter has quit [Ping timeout: 240 seconds]
smazga has joined #lisp
<Ober>
nvm that would be bash
smazga has quit [Ping timeout: 264 seconds]
manualcrank has quit [Quit: WeeChat 1.9.1]
Oladon has quit [Quit: Leaving.]
schweers has joined #lisp
varjag has joined #lisp
raghavgururajan has joined #lisp
<no-defun-allowed>
SBCL only understands civil UNIONs.
space_otter_ has quit [Remote host closed the connection]
<Ober>
sbcl --load foo.lisp -- $ARGS
<Ober>
so yeah, end of options beginning of arguments
<no-defun-allowed>
Hm, I think that's something programs parse themselves.
<Ober>
aye
<no-defun-allowed>
But the CL standard, again, only mentions civil UNIONs. Marriage operators are probably a SBCL-specific extension.
<Ober>
gotcha
<Ober>
so we need a bordeaux-pairing
<no-defun-allowed>
Could do, but CL is already ahead of other languages by supporting multiple inheritance; so it'd be a pity to leave support for polycules out. The cost for implementation is a bit higher though.
<Ober>
Does Pascal J. Bourguignon have an alias on #lisp?
Codaraxis__ has joined #lisp
<no-defun-allowed>
Yes, pjb, but you should avoid summoning him where possible.
<Ober>
oh betelguise must be the other person I was thinking of. thanks
<no-defun-allowed>
(You may think that I just contradicted myself, but he /ignore-d me so it does nothing.)
<Shinmera>
no-defun-allowed: how'd you achieve that
Codaraxis_ has quit [Ping timeout: 268 seconds]
<no-defun-allowed>
Shinmera: are you sure you want to know?
<Ober>
ahh needed his help fixing his godemichet. it failed to build on allegro and lw
<jackdaniel>
./win 27
hhdave has joined #lisp
<Ober>
irc is hard
enrio has joined #lisp
Hofpfister has joined #lisp
<pjb>
Ober: pjb
ljavorsk has quit [Quit: I'm out, bye]
ljavorsk has joined #lisp
nadare has joined #lisp
invergo has joined #lisp
invergo has quit [Changing host]
invergo has joined #lisp
refpga has joined #lisp
smazga has joined #lisp
smazga has quit [Ping timeout: 268 seconds]
ebrasca has quit [Ping timeout: 265 seconds]
ebrasca` has joined #lisp
gareppa has joined #lisp
Josh_2 has quit [Ping timeout: 240 seconds]
Josh_2 has joined #lisp
zaquest has quit [Quit: Leaving]
Hofpfister has quit [Remote host closed the connection]
Hofpfister has joined #lisp
Codaraxis_ has joined #lisp
Codaraxis__ has quit [Read error: Connection reset by peer]
refpga has quit [Remote host closed the connection]
gxt has quit [Ping timeout: 260 seconds]
ljavorsk has quit [Ping timeout: 268 seconds]
h116 has joined #lisp
jonatack has quit [Ping timeout: 252 seconds]
h11 has quit [Ping timeout: 265 seconds]
zaquest has joined #lisp
cosimone has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` has joined #lisp
X-Scale` is now known as X-Scale
augfab has joined #lisp
froggey has quit [Ping timeout: 240 seconds]
shifty has quit [Ping timeout: 240 seconds]
Hofpfister has quit [Ping timeout: 265 seconds]
liambrown has quit [Quit: 30 day idle timeout.]
mstdnuser[m] has quit [Quit: 30 day idle timeout.]
gxt has joined #lisp
jonatack has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
Hofpfister has joined #lisp
gareppa has quit [Quit: Leaving]
amerlyq has joined #lisp
ljavorsk has joined #lisp
mingus` has joined #lisp
smazga has joined #lisp
mingus has quit [Ping timeout: 240 seconds]
cosimone has quit [Quit: Terminated!]
lxbarbosa has quit [Remote host closed the connection]
ljavorsk has quit [Ping timeout: 268 seconds]
smazga has quit [Ping timeout: 240 seconds]
mingus` has quit [Remote host closed the connection]
froggey has joined #lisp
jonatack has quit [Quit: jonatack]
jonatack_ has joined #lisp
jonatack_ has quit [Client Quit]
jonatack_ has joined #lisp
jonatack_ has quit [Client Quit]
jonatack_ has joined #lisp
karswell has quit [Remote host closed the connection]
karswell has joined #lisp
jmercouris has joined #lisp
bitmapper has joined #lisp
orivej has joined #lisp
ljavorsk has joined #lisp
_paul0 has joined #lisp
paul0 has quit [Ping timeout: 268 seconds]
orivej has quit [Ping timeout: 250 seconds]
enrio has quit [Read error: Connection reset by peer]
enrio has joined #lisp
superkumasan has quit [Ping timeout: 240 seconds]
bitmapper has quit [Remote host closed the connection]
bitmapper has joined #lisp
superkumasan has joined #lisp
<thijso>
Is there some way to extract the dependency graph of Lisp packages? From Quicklisp or asdf maybe?
<Shinmera>
no
<Shinmera>
packages don't have dependency beyond what symbols they might import.
<Shinmera>
unless you mean systems, in which case obviously yes or ASDF and quicklisp couldn't do anything.
<thijso>
Sorry, I was unclear. In asd files packages define :depends-on (sometimes)
<thijso>
Yeah, Shinmera, I meant systems
<thijso>
But is there a way to get that info out of either asdf or quicklisp?
<thijso>
Maybe I need to dive into ql code...
<Shinmera>
Sure.
<Shinmera>
asdf has system-depends-on, and in QL every dist has a text file that describes every system and its dependencies
<Shinmera>
the text file is called systems.txt
<thijso>
(and I need to get it into my head that they are called 'systems', not 'packages'; or at least, that packages are something else)
<Shinmera>
you can also get that info programmatically from the ql-dist functionality.
<thijso>
Ah, that sounds promising. Thanks, Shinmera
ebrasca` is now known as ebrasca
froggey has quit [Ping timeout: 246 seconds]
EvW1 has joined #lisp
jeosol62 has joined #lisp
froggey has joined #lisp
duuqnd has joined #lisp
ljavorsk has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 250 seconds]
<jmercouris>
Shinmera: does your deploy handle CFFI by bringing the shared libraries into the app bundle?
<jmercouris>
and if so, how does it let CFFI know where to look for the shared libraries?
smazga has joined #lisp
orivej has joined #lisp
augfab has quit [Remote host closed the connection]
duuqnd has quit [Ping timeout: 265 seconds]
keep_learning has joined #lisp
stepnem has quit [Read error: Connection reset by peer]
smazga has quit [Ping timeout: 268 seconds]
stepnem has joined #lisp
<Xach>
thijso: ql-dist:dependency-tree code might help
<Xach>
thijso: loading an asdf system can make many other things load to support it (at load time, not build time). those prerequisites are not always explicit.
lucasb has joined #lisp
<Shinmera>
jmercouris: It has a deployment folder it copies the libraries into, yes.
<Shinmera>
jmercouris: It does the restoring by explicitly loading with the full path.
<Shinmera>
you're responsible for letting it know about implicit dependencies.
jonatack_ has quit [Ping timeout: 246 seconds]
<thijso>
thank, Xach, I'll take a look
<thijso>
s/thank/thanks/
refpga has joined #lisp
duuqnd has joined #lisp
flamebeard has quit []
Necktwi has joined #lisp
<d4ryus>
thijso: i guess you are looking for asdf/system:system-depends-on
<d4ryus>
thijso: forget what i said, i was reading old messages :/
EvW1 has quit [Ping timeout: 250 seconds]
<Xach>
thijso: what will you do with the dependency graph when you have it?
wxie has joined #lisp
<jmercouris>
Shinmera: how can it know the full path when it is in an app bundle that could be placed anywhere on disk?
<jmercouris>
Shinmera: are you using argv0 or something?
Necktwi has quit [Quit: leaving]
jonatack_ has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
shrdlu68 has quit [Ping timeout: 265 seconds]
jonatack_ has quit [Quit: jonatack_]
jonatack has joined #lisp
<Shinmera>
yes
warweasle has joined #lisp
gareppa has joined #lisp
zaquest has quit [Quit: Leaving]
<Shinmera>
Deploy's code isn't large. Wouldn't be hard to figure out how it works.
_paul0 has quit [Remote host closed the connection]
refpga has quit [Quit: ERC (IRC client for Emacs 26.2)]
stepnem has quit [Read error: Connection reset by peer]
_paul0 has joined #lisp
karlosz has quit [Quit: karlosz]
<beach>
pfdietz: Oh, thanks!
<pfdietz>
no-defun-allowed: I can see a case for putting docstrings in methods, to add to the general documentation at the defgeneric. For example, document method-specific keyword parameters.
quazimodo has quit [Ping timeout: 265 seconds]
<pfdietz>
It would be nice if the documentation were more structured, rather than just a string.
quazimodo has joined #lisp
<beach>
pfdietz: That's "easy". We just have to use something other than CL:DOCUMENTATION.
<jmercouris>
Yeah, but then we'd also have to update our editors to respect the indentation and format of a markup string within a regular string...
<jmercouris>
that's been a huge wish of mine for a long time, I especially don't like the de-dent of the documentation string after one line
smazga has joined #lisp
lxpnh98 has quit [Ping timeout: 268 seconds]
<beach>
jmercouris: That's why I am suggesting using something different altogether.
<jmercouris>
beach: I guess I don't understand what you are suggesting to use
<beach>
jmercouris: Like a CLIM-based documentation browser/editor.
<jmercouris>
Ah, OK, I have no experience with this
lxpnh98 has joined #lisp
<beach>
It would be part of an IDE that would allow you to access the documentation from the code.
<Shinmera>
FWIW documentation-utils allows you to store more complicated documentation elsewhere and at the same time compile that info down to a regular docstring.
<jmercouris>
So not directly embedding the documentation, but storing it in an associated data structure?
<Shinmera>
I think one extension library does that.
<pfdietz>
jmercouris: yes
<beach>
jmercouris: There are some YouTube presentations of Concordia, the documentation system in Genera.
<jmercouris>
That would have to be a very smart system
<jmercouris>
Any edits done to the files outside of the system could mean a loss of documentation
<pfdietz>
Er, wait.
<pfdietz>
No, I meant storing it as non-string data structures in the code.
<jmercouris>
pfdietz: like what? s-exp?
<beach>
I think that's a terrible idea.
<beach>
I think it is a terrible idea to store documentation as a string with the code as well.
<pfdietz>
Right. Bottom out as strings, but otherwise (for example) have an element documenting the meaning of parameters.
<jmercouris>
I like the documentation inline with the strings, it forces a succinctness
<jmercouris>
You can't ramble on and on, nor can you have massive functions with massive descriptions
retropikzel has quit [Remote host closed the connection]
Codaraxis has quit [Ping timeout: 268 seconds]
rixard has joined #lisp
gravicappa has quit [Ping timeout: 246 seconds]
jfrancis has joined #lisp
slyrus has joined #lisp
xuxuru has quit [Ping timeout: 260 seconds]
theBlackDragon has quit [Ping timeout: 240 seconds]
theBlackDragon has joined #lisp
Codaraxis has joined #lisp
xuxuru has joined #lisp
Codaraxis_ has joined #lisp
bitmapper has joined #lisp
Codaraxis has quit [Ping timeout: 268 seconds]
permagreen has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
skidd0 has joined #lisp
enrio has quit [Ping timeout: 245 seconds]
<skidd0>
hello, i'm trying to understand why sb-ext's timers are spamming a "WARNING: Startiong a poll(2) without a timeout while interrupts are disabled." message
<skidd0>
in SBCLs src, there's a unix.lisp file i'm looking at now
shifty has joined #lisp
<skidd0>
there's a note-dangerous-wait function that spits the warning
<skidd0>
which would be fine if it were just one warning
<skidd0>
but not the hundreds per second i'm seeing
rixard has quit [Quit: (exit)]
orivej has joined #lisp
<Xach>
skidd0: I don't know how to help, sorry. What platform are you using? (like os and architecture)
<skidd0>
this is on an ubuntu VM
invergo has joined #lisp
invergo has quit [Changing host]
invergo has joined #lisp
Codaraxis has joined #lisp
<skidd0>
any idea where i might go poking around ?
<Xach>
skidd0: the #sbcl channel might have an idea.
Codaraxis_ has quit [Ping timeout: 265 seconds]
<Xach>
skidd0: are you just testing out timers or are you actually doing "real" stuff while using them?
<skidd0>
trying to do real stuff with them
<skidd0>
have a task that needs to occur at a time and recur every 24 hours
<skidd0>
could just make it an executable and use CRON
<Xach>
skidd0: i wonder if the real stuff is somehow setting up an environment that leads to the warnings, or if timers just don't really work right now (through neglect or bitrot or something). i don't know the answer.
<Xach>
i don't think timers would be useful if you always got warnings like that.
<skidd0>
that was my gut feeling
<skidd0>
it had a bad smell
<skidd0>
do you know of any other scheduler library?
<mfiano2>
If you don't need resolution, just set up a background thread to wait for 24h before submitting a task. It's fairly easy with lparallel if you aren't comfortable with working with threading code at a low level
<thijso>
Xach: I'm working on building an app using ECL on android, and loading the libraries/fas file/whatever is proving finicky. I've figured out that making smaller fas files helps, so I'm separating the systems. But that means I need to load them in the correct order. So I want to extract the deps during the make phase and produce a load.lisp file that does that in the right way. I think I've mostly figured out
<thijso>
how.
<thijso>
But there are other challenges, too, so my attention is abit divided... now it looks like usocket is not playing nice, so diving into gdb again, I fear...
<thijso>
thanks for the pointer, pjb, I'll have a look
kajo has quit [Ping timeout: 252 seconds]
synaps3 has joined #lisp
<thijso>
d4ryus: that is indeed exactly what I ended up using, "system-depends-on"
permagreen has joined #lisp
theBlackDragon has quit [Ping timeout: 265 seconds]
theBlackDragon has joined #lisp
Josh_2` has quit [Remote host closed the connection]
Josh_2` has joined #lisp
lxbarbosa has joined #lisp
Lycurgus has quit [Quit: Exeunt]
<Xach>
thijso: interesting
amerlyq has quit [Quit: amerlyq]
skidd0 has left #lisp ["WeeChat 2.6"]
<Ober>
thanks for the help pjb, sorry I confused you with Jean-Phillippe Paradis
trocado has joined #lisp
<trocado>
hi! is it possible to delete an item from *features*?
<trocado>
(delete :item *features*) doesn't do it for some reason...
<mfiano2>
You might find something useful there if you look
<no-defun-allowed>
Say if you had the list (1 2 3) and you want to DELETE 1 from that, then you might just pop off the first cons. This doesn't change the list structure that you already have bound somewhere.
<White_Flame>
the call to DELETE would effectively return (cdr a), but it wouldn't change A
* White_Flame
half-beat no-defun-allowed to it
<trocado>
mfiano2: you mean deletef?
<mfiano2>
Yes
xuxuru has quit [Quit: xuxuru]
<mfiano2>
Expand it to see how it works
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
<pjb>
trocado: so, in short, functions like delete or remove are functional functions: you must use the result. (setf *features* (delete feature *features*))
<_death>
another example is (let ((a (list 1))) (delete 1 a) a) .. delete can't set the A
<_death>
all it receives is the cons cell
<pjb>
trocado: in addition to the case indicated by White_Flame, notice that the empty list is represented by a SYMBOL, while non-empty lists are represented by a chain of CONS cells. There's no way to change a CONS cell into a SYMBOL, when deleting the last element of the list.
<White_Flame>
a basic piece of understanding is that there is no such singular data item that is a "list". It's simply an ad-hoc chain of cons cells, and a variable simply points to one of those. If you muddle with the linkage, it might not be properly pointing at the 'head' cell anymore
<mfiano2>
In contrast, you might not want to keep references around after a SORT. You might want to copy the structure first if you need them.
<pjb>
trocado: to be able to have a mutation API for list, you would have to wrap lists in an object, and use mutating methods on that object.
<trocado>
This is much clearer now. Thank you guys for all the info!
orivej has quit [Ping timeout: 246 seconds]
invergo has quit [Ping timeout: 268 seconds]
smazga has quit [Quit: leaving]
stzsch has joined #lisp
<aeth>
I personally use a 0D array (i.e. (make-array '())) if I need to wrap a list in an object for mutation because it's the simplest object that fit that role. I might be the only one, though.
<aeth>
That only matters if you're crossing a function boundary, though. For a local variable or a global variable, you can just mutate it directly, like with *features*
<aeth>
Other candidates for a simple wrapper are a 1D array of length 1, or even the car of a cons with a nil cdr.
<aeth>
And some people might want a more explicit interface, using defclass or defstruct to define the container.
<aeth>
Personally, I would do this for a global variable. (Obviously, you can't change what *features* is, though.)
<pjb>
aeth: personally, I use a standard-object of a subclass of standard-class, because it let me dispatch my generic functions to different methods for lists than for vectors and other classes.
<pjb>
aeth: and while you're wrapping lists, you can add slots to optimize some operations, such as length, append, etc.
slyrus_ has joined #lisp
slyrus has quit [Ping timeout: 246 seconds]
sjl has quit [Ping timeout: 240 seconds]
bitmapper has quit [Read error: Connection reset by peer]
bitmappe_ has joined #lisp
<aeth>
pjb: Yes, that (or a struct with a :type in its slot for potential compiler efficiency, although if you want efficiency, then you probably shouldn't be using a global) is the more formal way of doing it and good for globals, but if you're just passing something as an argument to an essentially internal function, a simpler container might be preferable. It's a matter of taste, really. Imo.
<aeth>
(And actually a struct might be the most efficient way to do it altogether, although it probably doesn't really matter.)
LiamH has quit [Quit: Leaving.]
<aeth>
I'm guessing that the most proper way (i.e. a good public API) is probably defclass, and the most efficient way is probably defstruct (although the fixed costs might not outweigh the performance gain of having known types), and the simplest way is probably simply reusing a 0D array, a 1-length 1D array, or a cons.
<aeth>
s/might not outweigh/might outweigh/
zmt01 has quit [Read error: Connection reset by peer]
zmt01 has joined #lisp
theruran has joined #lisp
synaps3 has quit [Read error: Connection reset by peer]