<ixelp>
An immodest proposal for array-of-structs · GitHub
<aeth>
the controversy of these sorts of things (I've made some proposals myself in the past on IRC) makes me think that a non-ARRAY thing actually has a chance of getting added
<pjb>
pdietz: you can do that trivially, by adding a dimension (the number of slots).
<pdietz>
Sure. That would not be a structure object to the rest of Lisp, though. I suppose you could pull out a displaced-to vector, but I doubt that's efficient.
<pjb>
pdietz: you could provide two names or build to names, eg. points and point and expand a (defstruct point x y) and have functions to assign and copy between points entries and point structures.
<pjb>
pdietz: you could use displaced arrays to map entries in the array to (defstruct (foo (:type vector)) …)
<pjb>
and (:named nil)
skin has quit [Remote host closed the connection]
<pjb>
but apparently, defstruct generates accessor that expect a simple-vector, so it doesn't work with displaced vectors. We have to generate our own accessors.
jmdaemon has quit [Remote host closed the connection]
jmdaemon has joined #commonlisp
random-nick has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
aartaka has quit [Ping timeout: 255 seconds]
contrapunctus has joined #commonlisp
aartaka has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
Major_Biscuit has joined #commonlisp
AadVersteden[m] has joined #commonlisp
<AadVersteden[m]>
I have an itch which I don't intend to act on, yet still: does SBCL have a fast way of doing matrix multiplication of numbers?
<jackdaniel>
I don't think that there is anything bultin. there are libraries for that though - magicl is one, another is 3d-matrices (I think); there's also petalisp if you feel like getting adventurous
MajorBiscuit has quit [Ping timeout: 246 seconds]
<jackdaniel>
as of the speed, I suppose it varies between solutions
<AadVersteden[m]>
I think it'll be two two-dimensional bit-vectors so in reality I can do a bitwise and.
<AadVersteden[m]>
jackdaniel: thank you, I'll read the readme and that should be enough to get this out of my head :D
<beach>
I suspect the AMOP is the only choice for the former.
<mariari>
Yeah I've read through and started to implement the AMOP book in factor, but didn't get as far as funcallable-standard-class
<mariari>
I really should learn how to utilize some of these patterns better
<jackdaniel>
there isn't much to funcallable-standard-class - your class needs to have a metaclass funcallable-standard-class and then you set the function of an instance with set-funcallable-instance-function
<jackdaniel>
other than that funcallables are instances like any other - you may add slots with accessors etc
<jackdaniel>
to associate such funcallable with a symbol simply do (setf (fdefinition 'funciton) #<my-instance>)
<mariari>
This seems great, this is a way to have hooks upon functional creation right?
<beach>
mariari: Funcallable instances are more like generalized functions where you can store things in slots as jackdaniel points out.
<jackdaniel>
you could use it for that I guess. another use case would be for example associating argument parsers with the function
<beach>
mariari: For generic functions, those slots hold things like methods.
<mariari>
beach: that does sound neat, I think an issue I had in the past was making languages I created interoperate with CL, I think the redefinition issue was on the CL side rather than the language side. But I can imagine using this for some things
<mariari>
jackdaniel: that does seem like a good use for that, is there good uses for this in the wild, just saw it in my nyxt code, while writing an email responding to someone
<jackdaniel>
I don't know, I have not used it in any open source code so far
<mariari>
how did it work out for you in private code that you've worked on?
<jackdaniel>
it works just fine
skin has joined #commonlisp
skin has quit [Remote host closed the connection]
kevingal has joined #commonlisp
skin has joined #commonlisp
rtoy has quit [Quit: rtoy]
chrcav has quit [Ping timeout: 268 seconds]
<beach>
I think jackdaniel hinted about associating a parser with the function. CLIM does this for commands, so that would be one use for funcallable standard objects.
<jackdaniel>
currently we keep parsers in hash tables, but switching commands to be funcallable-standard-instances would be nice
<jackdaniel>
we could then encapsulate all important information with the function
<beach>
Exactly.
<beach>
And I use host funcallable standard objects to hold SICL generic functions during bootstrapping.
<beach>
scymtym: I would even argue that its the only right way to do it. Then the hash table wouldn't have to be weak, for instance.
<jackdaniel>
these hash tables are associated with command tables
<scymtym>
beach: the thing i liked most about implementing commands as funcallable instances was replacing the huge generated parser functions
<jackdaniel>
so if the command is removed from the command table then parsers are also removed (i.e there is no need for weak keys or values)
<beach>
jackdaniel: I see.
<jackdaniel>
generally what scymtym says, that would reduce complexity (at the expense of slightly violating the specification)
<beach>
scymtym: How does funcallable standard objects simplify that aspect?
Major_Biscuit has quit [Ping timeout: 246 seconds]
<beach>
s/does/do/
Major_Biscuit has joined #commonlisp
aartaka has quit [Ping timeout: 276 seconds]
aartaka has joined #commonlisp
<scymtym>
beach: the funcallable object can store data about the parameters and interpret that data when parsing. i suppose this would work with regular functions as well but less conveniently. for example, if you want to reuse the same function for all commands, you cannot close over the parameter data. to be honest, i don't have this fresh in my mind since i implemented it some time ago
<beach>
OK, thanks. I think I see.
<mariari>
thanks for the link scymtym
<mariari>
I will hopefully absorb all these ideas
X-Scale has quit [Quit: Client closed]
X-Scale has joined #commonlisp
X-Scale has quit [Client Quit]
jmdaemon has joined #commonlisp
aartaka has quit [Ping timeout: 250 seconds]
aartaka has joined #commonlisp
X-Scale has joined #commonlisp
Cymew has quit [Ping timeout: 268 seconds]
skin has quit [Quit: Leaving.]
skin has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
skin has quit [Ping timeout: 252 seconds]
X-Scale has quit [Quit: Client closed]
jmdaemon has quit [Ping timeout: 246 seconds]
skin has joined #commonlisp
frgo has joined #commonlisp
random-nick has quit [Ping timeout: 250 seconds]
cage has joined #commonlisp
chrcav has joined #commonlisp
pdietz has quit [Ping timeout: 260 seconds]
jmdaemon has joined #commonlisp
random-nick has joined #commonlisp
X-Scale has joined #commonlisp
<NotThatRPG>
Lazy programmer question: Anyone have a comparison function for sorting s-expressions roughly lexicographically? I can definitely write one myself, but if someone's done it, I'd love to save myself the trouble
Brucio-61 has quit [Ping timeout: 260 seconds]
markb1 has quit [Quit: Leaving]
scymtym has quit [Ping timeout: 246 seconds]
masinter has quit [Ping timeout: 250 seconds]
Brucio-61 has joined #commonlisp
<jackdaniel>
(curry #'every #'<*) or something
occ has quit [Ping timeout: 246 seconds]
scymtym has joined #commonlisp
attila_lendvai has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
occ has joined #commonlisp
rgherdt_ has joined #commonlisp
rgherdt has quit [Ping timeout: 260 seconds]
<NotThatRPG>
@jackdaniel: Is <* a thing?
Krystof has quit [Ping timeout: 248 seconds]
Major_Biscuit has quit [Quit: WeeChat 3.6]
<NotThatRPG>
I was thinking this would involve some fussy choices about when to use string-< and when < since the latter doesn't generalize over strings, and thinking about what to do when comparing lists and atoms (I'd prefer the latter come first). Not so?
* NotThatRPG
suspects he actually wrote this at least once, but doesn't have it any more
<Bike>
i don't think there's any obviously right way to compare a string and a number, or what have you. depends on what you need for your application
<Bike>
that's where <* comes in, i imagine
<White_Flame>
especially where you have for instance 0 and "0"
<White_Flame>
or "FOO" vs FOO
<Bike>
or FOO vs (#\F "O" #(#\O))
pdietz has joined #commonlisp
amoroso has joined #commonlisp
masinter has joined #commonlisp
<NotThatRPG>
Bike: I am just looking for something that is lexicographic-ish -- I'd like to make a list of s-expressions easier for a human (particularly a debugger) to read, so it would be nice to make it something like library order, but it's not hugely important.
<NotThatRPG>
It would probably be enough to have numbers all come before symbols, strings or lists, symbols and strings sorted with string-<= , lists last, and sorted recursively.
<NotThatRPG>
Just so that one could eyeball one of these lists and not go far wrong
<NotThatRPG>
Handy for symbolic computing applications.
<NotThatRPG>
where s-expressions represent logical formulas
<NotThatRPG>
s/formulas/literals/
Gleefre has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 250 seconds]
szkl has joined #commonlisp
Bike has quit [Ping timeout: 248 seconds]
morganw has joined #commonlisp
tyson2 has joined #commonlisp
Bike has joined #commonlisp
Bike has quit [Remote host closed the connection]
Bike has joined #commonlisp
Bike has quit [Remote host closed the connection]
pdietz has quit [Ping timeout: 260 seconds]
jmdaemon has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
amoroso has quit [Quit: Client closed]
rgherdt has joined #commonlisp
rgherdt_ has quit [Ping timeout: 265 seconds]
amoroso has joined #commonlisp
azimut has quit [Ping timeout: 255 seconds]
Inline has joined #commonlisp
kenran has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 28.2]
jmdaemon has joined #commonlisp
aartaka has quit [Ping timeout: 250 seconds]
aartaka has joined #commonlisp
kevingal has quit [Ping timeout: 276 seconds]
attila_lendvai has joined #commonlisp
X-Scale has quit [Quit: Client closed]
Inline has quit [Quit: Leaving]
aartaka has quit [Ping timeout: 264 seconds]
aartaka has joined #commonlisp
mingus has quit [Quit: mingus]
Bike has joined #commonlisp
pve has quit [Ping timeout: 248 seconds]
pve has joined #commonlisp
Devon777 has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
Devon77 has quit [Ping timeout: 265 seconds]
eddof13 has joined #commonlisp
eddof13 has quit [Client Quit]
aartaka has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
aartaka has quit [Ping timeout: 268 seconds]
amoroso has quit [Ping timeout: 260 seconds]
akoana has joined #commonlisp
LW has quit [Quit: WeeChat 3.6]
yottabyte has quit [Quit: Connection closed for inactivity]
LW has joined #commonlisp
kenran has quit [Remote host closed the connection]
shka has quit [Ping timeout: 265 seconds]
skin has quit [Remote host closed the connection]
Krystof has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
OlCe has quit [Ping timeout: 246 seconds]
attila_lendvai has quit [Ping timeout: 276 seconds]
occ has quit [Ping timeout: 255 seconds]
<pjb>
NotThatRPG: a Q&D such function is (lambda (a b) (string< (prin1-to-string a) (prin1-to-string b)))
<pjb>
NotThatRPG: the problem is to order the classes of arguments.
semz has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
<pjb>
NotThatRPG: and then, there are classes that don't have a natural order, eg. standard-object.
semz has joined #commonlisp
LW has quit [Quit: WeeChat 3.6]
OlCe` has joined #commonlisp
nij- has joined #commonlisp
<nij->
Hello :) I have a class PERSON, currently without a customized print-object method (so it's printed unREADbly). How do I modify its printer so that only when *print-readably* is true the effect I want takes over; otherwise we use the original printer?
<nij->
However, as I inspect the PRINT-OBJECT generic function, it seems that there's no method for PERSON yet. I'm not sure why call-next-method would work.
<Bike>
the next-method is for standard-object or something
<ixelp>
Is it possible to develop and compile openmusic without Lispworks? · Issue #25 · openmusic-project/openmusic · GitHub
<pjb>
gsharp has its own file formats and editing concepts. I doubt you can easily use it as a replacement for just the GUI of OpenMusic. At least, you'd have to write format converters.
morganw has quit [Remote host closed the connection]