phoe changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
eugercek has quit [Remote host closed the connection]
mepy_ has joined #commonlisp
mepy has quit [Ping timeout: 240 seconds]
Oladon has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
pillton has joined #commonlisp
yewscion has quit [Ping timeout: 250 seconds]
VincentVega has quit [Ping timeout: 256 seconds]
Oladon has quit [Quit: Leaving.]
mon_aaraj has joined #commonlisp
Bike has joined #commonlisp
lottaquestions has quit [Quit: Konversation terminated!]
morganw has quit [Remote host closed the connection]
orestarod has quit [Ping timeout: 240 seconds]
notzmv has quit [Ping timeout: 240 seconds]
unyu has quit [Quit: brb]
rotateq has quit [Quit: ERC (IRC client for Emacs 27.2)]
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
Bike has quit [Quit: Connection closed]
mon_aaraj has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
Oladon has joined #commonlisp
mon_aaraj has quit [Ping timeout: 250 seconds]
mon_aaraj has joined #commonlisp
SR-71 has joined #commonlisp
mon_aaraj has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
<beach> Good morning everyone!
<SR-71> Good morning.
<SR-71>
unyu has joined #commonlisp
semz_ has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
semz has quit [Ping timeout: 240 seconds]
Oladon has quit [Quit: Leaving.]
waleee has quit [Ping timeout: 256 seconds]
lagash has quit [Quit: ZNC - https://znc.in]
lagash has joined #commonlisp
notzmv has joined #commonlisp
dre has joined #commonlisp
aartaka has joined #commonlisp
<char[m]> Hi, is there any function in ANSI CL that takes a function as an argument and returns an function?
<beach> Sure.
<beach> clhs identity
<beach> That's one.
<beach> char[m]: But perhaps you want the value to have a more complicated relation to the argument?
<char[m]> Actually, for my purposes, IDENTITY is perfect, I can't believe I did not think of it. Thanks beach.
<beach> Sure.
<char[m]> something more simmilar to alexandria:compose would be nice though.
<aeth> complement also exists
<beach> True.
<beach> Since Common Lisp is not a purely functional language, you won't find the battery of function-manipulating functions that are common in such languages.
<aeth> If you're using alexandria, you might want curry/rcurry
<aeth> (funcall (alexandria:curry #'+ 1) 2) => 3
<aeth> (obviously #'1+ exists for that particular example)
<aeth> perhaps more usefully... (mapcar (alexandria:curry #'+ 2) '(1 2 3)) => 3 4 5
<char[m]> thanks. I know, I'm just trying to produce a simple example that I do need any libraries for.
<aeth> char[m]: maybe this? (mapcar (complement #'evenp) '(1 2 3)) => (T NIL T)
<aeth> Because then you can make the obvious observation that (complement #'evenp) should behave the same as #'oddp
<aeth> And then you can use another function that doesn't have a built-in complement as your next example
<char[m]> very nice
robin has quit [Quit: Leaving]
robin has joined #commonlisp
jealousmonk has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 27.1)]
anticomputer_ is now known as anticomputer
wacki has joined #commonlisp
hashfuncf15 has joined #commonlisp
<hashfuncf15> is there a way to be verbose about reader macros?
<hashfuncf15> like, in the repl, if i type ... 'hello ... that it will print ... (quote hello) ... ?
notzmv has quit [Ping timeout: 240 seconds]
semz_ is now known as semz
shka has joined #commonlisp
pillton has quit [Remote host closed the connection]
mon_aaraj has quit [Ping timeout: 250 seconds]
<beach> hashfuncf15: Well, if it is the REPL, it will be evaluated, so the value will be printed at the end, and the value is not (QUOTE HELLO) but HELLO.
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
<moon-child> hashfuncf15: you may type (read-from-string "'hello")
<moon-child> alternately (and somewhat more practically), you can simply quote again, as in ''hello
pranavats has joined #commonlisp
<beach> I think the idea was to avoid that the printer uses the short form.
<hashfuncf15> beach: yes that's the idea
<hashfuncf15> & my fault. i meant if i type ... ''hello ... that the repl will print ... (quote hello) ...
<moon-child> right
<hashfuncf15> i'm wondering if there's some sort of verbose printing variable or function that i'm unaware of
<moon-child> I don't know of a way. You may do (type-of ''hello), which will evaluate to CONS, hinting that you can look at (car ''hello) and (cdr ''hello)
<hashfuncf15> moon-child: ok thanks for the help
rotateq has joined #commonlisp
pve has joined #commonlisp
<White_Flame> hashfuncf15: if you set *print-pretty* to nil, then it'll print (QUOTE HELLO) instead of 'HELLO
<White_Flame> as well as (FUNCTION FOO) instead of #'FOO etc
mon_aaraj has joined #commonlisp
treflip has joined #commonlisp
waleee has joined #commonlisp
s-liao has joined #commonlisp
s-liao has quit [Client Quit]
lottaquestions_ has joined #commonlisp
Nilby has joined #commonlisp
s-liao has joined #commonlisp
<hashfuncf15> White_Flame: thanks. that's what i was looking for
<hashfuncf15> ``hello ... prints: ... (SB-INT:QUASIQUOTE HELLO)
<qhong> Is there a way to tell SBCL that any objects allocated within a dynamic extent will become garbage outside that extent? (declare dynamic-extent) seems to work only for values bound at the boundary of the dynamic extent? E.g. (let ((x (list nil))) (setf x (list 1))), is there a way to tell SBCL the second list live only shortly?
rogersm has quit [Quit: Leaving...]
<qhong> I guess it can't be stack allocated anyway, it is best handled by some memory pool, does SBCL have such facility?
<semz> If I remember correctly, (let ((x (list nil)) (declare (dynamic-extent x)) (setf x (list 1))) already declares the (1) as of dynamic extent, provided that no other variable refers to it, because it will be otherwise inaccessible.
<qhong> `time' tells me that it CONSes. This makes sense, as in the body of the code there's in general no way to how many times `list' get called, it might even get called infinity times. So there's no way to know how much stack space to reserve for it.
<qhong> So I'm asking for a memory pool.
<qhong> (replace-string "no way to how many" "no way to know how many")
<beach> qhong: Does your application use a lot of time in the garbage collector?
s-liao has quit [Ping timeout: 256 seconds]
<qhong> beach: empirically not a lot, but in a previous iteration I source-coded/compressed heap-allocated vector into (unsigned-byte 64) and it's 5 times faster
<beach> I am asking because the programmer is often wrong about the liveness of objects, which is why there are so many memory leaks and premature deallocations in languages without automatic memory management.
<qhong> I think it might be 1. allocating itself is not so fast, or 2. cache locality
<beach> Plus, liveness changes as a result of maintenance, which, if the programmer handles it manually, will typically introduce bugs that are hard to find. This is why we have automatic memory management in the first place, of course.
notzmv has joined #commonlisp
<qhong> Yes I'm big fan of GC I always want to yeet stack all together and heap-allocate activation records in my own (hypothetical) language
<qhong> Just in this case I happen to need some extra performance
hashfuncf15 has quit [Ping timeout: 240 seconds]
<moon-child> why heap-allocate activation records
<moon-child> ?
<moon-child> continuations or ?
<qhong> yes and environment
aeth has quit [Ping timeout: 256 seconds]
aeth has joined #commonlisp
szkl has joined #commonlisp
Guest491241242 has joined #commonlisp
eugercek has joined #commonlisp
Guest491241242 has quit [Client Quit]
psycomic has joined #commonlisp
waleee has quit [Ping timeout: 256 seconds]
psycomic has quit [Client Quit]
nature has joined #commonlisp
cosimone has joined #commonlisp
Guest74 has quit [Remote host closed the connection]
karlosz has quit [Quit: karlosz]
perrierjouet has joined #commonlisp
treflip has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
cage has joined #commonlisp
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<mfiano> What's a decent way to create a list of 1 or 2 elements, from 2 variables: if both bindings have the same value, it is 1 element, if not, the list is the first value followed by the second value?
<mfiano> I was trying to be clever without branching. Maybe I should abort to what comes naturally
<semz> I don't see how you could avoid branching.
<phoe> you need to conditionalize on (eq x y) anyway
<semz> (remove-duplicates (list a b)) ; :-)
tyson2 has joined #commonlisp
<mfiano> Well now I feel dumb
<phoe> this hides the EQL test inside REMOVE-DUPLICATES and always conses two cells instead of maybe just one
<semz> It's still branching of course, but maybe it's more readable
<mfiano> Yes it certainly is
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
orestarod has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
random-nick has joined #commonlisp
<_death> another is (adjoin a (list b))
s-liao has quit [Ping timeout: 256 seconds]
szkl has quit [Quit: Connection closed for inactivity]
<phoe> _death: I actually like that one
<phoe> I didn't think of using ADJOIN
<mfiano> That's the one I was trying to remember!
razetime has joined #commonlisp
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
s-liao has joined #commonlisp
danieli has quit [Quit: Alpine Linux, the security-oriented, lightweight Linux distribution]
danieli has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
jeosol has quit [Quit: Client closed]
amb007 has quit [Ping timeout: 250 seconds]
treflip has joined #commonlisp
amb007 has joined #commonlisp
s-liao has quit [Quit: Client closed]
<dieggsy> anyone know how ctags knows about e.g. defclass (and even a custom define-class macro) when i can find no mention of it in the sources? https://github.com/universal-ctags/ctags
<dieggsy> but then not slots. ...interesting lol
<phoe> dieggsy: uhh, is this a #common-lisp question?
<phoe> plus I didn't really understand what you are asking about
<dieggsy> I mean it's related to common lisp since I'm asking about using ctags with common lisp. Happy to move it elsewhere if it's not welcome I suppose
<phoe> what's a ctag?
<phoe> oh, some sort of code navigation thing
<phoe> I use slime's navigation instead
<mfiano> It's for people that don't know about our tooling.
<dieggsy> lol
<dieggsy> I use slime too guys
<dieggsy> sometimes i need to look up a symbol that's not loaded into slime though
<mfiano> You must be using it wrong. ctags cannot possibly know information dynamic to the runtime.
<gjvc> ctags is cross-language though and very fast. i've used it to shame a few smug java developers in the past
jeosol has joined #commonlisp
<gjvc> "multi-language" i mean
<dieggsy> mfiano: i must be using which wrong?
<mfiano> If your code is not loaded into your image, then I would say you are not using Common Lisp correctly, as it is an interactive language.
<mfiano> If it is loaded into your image, then SLIME/SLY will offer you much more introspection capabilities.
euandreh has quit [Ping timeout: 256 seconds]
<dieggsy> mfiano: Most of the time, my code is loaded into my image. Sometimes, there is code that is not. I'd say our code base at work probably does not use common lisp correctly - there are two separate (very large) packages with a lot of dependencies and shared code that can't be loaded together without breakage. i'm working to fix this, but I can't do much about it in its current state
<dieggsy> so i was exploring ctags. no harm in exploring other tools, even if they are inferior
euandreh has joined #commonlisp
Dynom has joined #commonlisp
Inline has quit [Ping timeout: 252 seconds]
<phoe> well, I have no idea if ctags are anyhow supported in CL
<phoe> one reason is the popularity of slime/sly
<phoe> another is the fact that in the general case you don't know what symbols and definitions you're going to have until you evaluate your Lisp code
<dieggsy> phoe: correct. there is a very limited form of support - namely what you can clean from static analysis, and even that is vastly incomplete. but (probably due to a bug), it somehow simultaneously correctly finds both more (and less, i guess) than i would expect it to
<dieggsy> in any case, i wouldn't want to continue to ramble off topic if it's disruptive, so i'm happy to move past it. no worries. i appreciate the conversation
ldb has joined #commonlisp
aeth has quit [Ping timeout: 256 seconds]
aeth has joined #commonlisp
tane has joined #commonlisp
Guest74 has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
pranavats has joined #commonlisp
mon_aaraj has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
razetime has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
razetime has joined #commonlisp
SR-71 has quit [Remote host closed the connection]
razetime has quit [Client Quit]
razetime has joined #commonlisp
razetime has quit [Client Quit]
razetime has joined #commonlisp
razetime has quit [Client Quit]
<Guest74> so in my dreams I came across a journal article entitled 'the non-extensibility of P'.  Which got me thinking.  In lisp i think we could extend the object itself by doing such things as injecting superclasses, but most 'extensions' seem to come by adding functions that add the ability to interpret or use the object in a different manner.  In
<Guest74> what sorts of situations is it best to mangle the object instead of adding functionality through functions?
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
<phoe> it's a hard question to answer generally, since ultimately all concrete behavior is defined by methods
<phoe> even harder in Common Lisp because of CHANGE-CLASS which is yet another way of mangling an object
<phoe> except it one that can directly influence the applicable methods
<phoe> s/it/it's/
amb007 has quit [Ping timeout: 272 seconds]
<Guest74> yeah, change-class is one of the one's I'm not sure about when, if at all, it's good to use.  Not sure about the injecting superclasses either. like, has anybody actually used that in production code?
<phoe> change-class is fun for programmatic use when you have a set of classes that will not be extended by the user - then, instead of setting and conditionalizing on a flag inside an object, you simply change its class and this way the dispatch mechanism becomes the conditionalizer
<phoe> injecting superclasses is super-fun for custom metaclasses, do you mean something like https://github.com/robert-strandh/Stealth-mixin/blob/master/stealth-mixin.lisp ?
<Guest74> I think stealth is the only one I've heard of.  But I've never heard of someone using it.
<phoe> mostly because this technique is easy to reinvent
<Guest74> the cluffer one is interesting.  I'll have to think about that.
amb007 has joined #commonlisp
<phoe> where a superclass ALWAYS-BOUND-OBJECT is always added to instances of an ALWAYS-BOUND-CLASS
mrcom has quit [Quit: Leaving]
<Shinmera> My favourite uses of change-class are twofold: 1) in cl-markless I eagerly create a parse-tree from the source markless text. If an eager parse is noticed to be invalid at a later point, instead of unwinding I change-class the relevant node into one without semantics and carry on. 2) in Trial I let objects refer to resources such as texture before they're even generated from sources like model
<Shinmera> files. Once the asset that generates them is loaded, I change-class this placeholder resource into the actual texture resource that carries the data and information. This avoids having to do a repeated lookup at runtime of the resource, or having to somehow re-traverse the scene graph and patch up references to resources now that they've been properly generated.
<Guest74> 2 sounds interesting.  Any particular file I can look at to see how you do it?
eugercek has quit [Ping timeout: 256 seconds]
<Shinmera> 1) isn't interesting? That makes me sad
<phoe> Guest74: ever heard about forward-referenced-class?
<phoe> 2) seems similar to the concept
<Guest74> i was just going to write, maybe I should think about 1.  I haven't parsed to classes because of that catch, this might be a way to change that.
<Guest74> phoe: nope, I have no comp sci education.
<phoe> Guest74: it's a Common Lisp MOP term
<Guest74> i have no mop education :)
<Shinmera> I don't think it'll be immediately clear how it works from those files. Not that the trick is very hard to implement, either.
<phoe> the one that allows you to (defclass foo (bar) ()) without BAR defined
<phoe> in particular, see (defclass foo (bar) ()) (find-class 'bar)
<Guest74> Shinmera: code always helps me to visualize it, at least something to follow a trail.
<Guest74> I know I certainly need to change my parsing tools. I feel I should have something more generalizable instead of extremely format specific.
ldb has quit [Ping timeout: 256 seconds]
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
treflip has quit [Quit: good night]
azimut_ has quit [Remote host closed the connection]
azimut has joined #commonlisp
notzmv has quit [Ping timeout: 240 seconds]
tyson2 has quit [Remote host closed the connection]
kevingal has joined #commonlisp
akoana has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
Devon has quit [Ping timeout: 256 seconds]
McParen has joined #commonlisp
waleee has joined #commonlisp
rgherdt has joined #commonlisp
Inline has joined #commonlisp
<shka> change-class is fine and useful tool
<shka> i usually use it in cases as described by Shinmera in 1)
<shka> never actually thought about 2) but it makes sense after reading it
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
hobo has quit [Ping timeout: 252 seconds]
notzmv has joined #commonlisp
Devon has joined #commonlisp
perrierjouet has quit [Ping timeout: 240 seconds]
tyson2 has joined #commonlisp
aun has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
<Guest74> I have a naming question. In transforming c headers to lisp for ioctl requests, I thought I'd just do the standard constant naming and muff them with '+.  However, some of them take parameters, such as length of supplied buffer.
<phoe> this sounds like function calls rather than constants
<Guest74> So since they're macros or functions(can't decide), should I remove the muffs?  But then it seems inconsistent with the other requests.
<phoe> what are the other requests?
<Guest74> constants
<phoe> zero-arg functions, then, maybe?
kevingal_ has joined #commonlisp
<Guest74> they're really constants.  There's a calculation involved, but they end up 32 bit integers.
<phoe> how do they take parameters if they are constants
<Guest74> you said the other requests.  There's the constants, and there's the ones that take parameters.  In C they're just defines present all uppercase.
<phoe> oh, I misunderstood - OK
<phoe> so, in C, some of them are like FOO, while others are BAR(...)?
<Guest74> I'm thinking maybe remove all the muffs for consistency.  but then besides slime telling you, how would you know it takes a parameter?
<phoe> could you point to the C sources?
<Guest74> sure, if you're on linux /usr/include/linux/input.h is one that takes args
<Guest74> e.g. EVIOCGNAME
<phoe> yes, I see, IMO that's a naming inconsistency on linux side
<phoe> these are actually zero-argument macros that omit their empty parentheses
nature has quit [Remote host closed the connection]
<phoe> I would have all of them be functions and have some of them take zero arguments, even if just for consistency
<Guest74> but in lisp I think they're best translated as constants.
<Guest74> because they're just 32bit constants.
<phoe> but then you would need to have calls like (+eviocgmtslots+ len) which would confuse me a lot
<phoe> and I guess they would also confuse other people
<Guest74> yeah, though this is just low level, so my library for this won't expose any of that.
<phoe> like, the final result might be an (unsigned-byte 32) but in general a value cannot be a constant if it depends on its arguments
<Guest74> thinking if somebody else wants to use the ioctl macros as well as the header parsers, so figuring out what the parser should spit out.
<phoe> if anything, I could imagine a call like (ioctl +eviocsff+)
<phoe> or (ioctl +eviocgkey+ len)
<pjb> Or, instead of thinking in terms of functions and constant variables and other CL stuff, you could think in terms of the problem domain, and invent your own mini DSL.
<Guest74> That's pretty much what the function calls I wrote look like.
<phoe> oh, good
<phoe> then, well, that's what I would do
<Guest74> at a low level.
<Guest74> higher level is evdev:get-key
<pjb> So you can choose any convenient syntax.
<phoe> the ioctl "types" themselves are constants, and then arguments can "modify" these constants in some way, depending on the sort of ioctl that is being issued
<Guest74> though only some can be modified, and in this case only those that return strings.  So maybe I could just hardcode a max string buffer and have them all constants.
<Guest74> ugh, no, that doesn't work, some take events.
<Guest74> I guess I'll just leave the low level inconsistent.
<Guest74> pjb: I'd rather something that maps quite easily to the header files.  That way I don't really have to write anything, just parse the header into lisp that looks pretty much the same.
<Guest74> e.g. (defconstant +EVIOCSFF+   (_IOW #\E #x80 ff_effect)  "send a force effect to a force feedback device")
cosimone has quit [Remote host closed the connection]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<Guest74> what's another good name for something that can both read and write? I don't quite like the term accessor as a suffix.
<pjb> Guest74: #define defines macros. (defmacro EVIOCSFF (ff_effect) `(_IOW #\E #x80 ,ff_effect))
<Guest74> in that case it doesn't actually take a struct.  It just uses the name to determine the size in bytes of the struct.
amb007 has joined #commonlisp
<Guest74> which makes it really easy to parse the header into lisp, because it's basically the same.
hobo has joined #commonlisp
<Guest74> though I guess that brings up the question, if a macro doesn't take an arg and is always the same, does the compiler just turn it into a constant?
hobo_ has joined #commonlisp
hobo has quit [Ping timeout: 272 seconds]
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
<aun> Is there a way to prevent inheriting from a structure?
<rotateq> aun: yes you have the :include option to inherit from one other struct
<aun> The question was can I prevent users from inheriting from the structure I made
<rotateq> oh oh course o.O hmm
<Guest74> maybe naming it with an uninterned symbol.
<Guest74> why do you want to prevent that?
<aun> I would really like if structures didn't have inheritance at all. This allows for more efficient structures operations, like copying/comparison and such, because you could statically determine which slots are to be compared/copied etc
aartaka has quit [Ping timeout: 272 seconds]
<Guest74> I don't think you have that problem.
triffid has quit [Ping timeout: 240 seconds]
<shka> aun: don't export structure name?
<aun> uhh, I understand the idea but this is more of a "don't do this" rather then "it's impossible to do this"
hobo_ has quit [Ping timeout: 256 seconds]
<Guest74> you can still :include unexported structs
<shka> yes
<shka> but in that case you are asking for problems
hobo has joined #commonlisp
<shka> lisp has very limited set of features to actually prohibit you from something
<Guest74> I don't know if it's just sbcl, but uninterned symbols works.
<shka> i guess maybe you can add some after method with assert
<shka> still, this will be error on the initialization, not subclassing
<shka> overall, my advise is: don't worry about it :-)
aartaka has joined #commonlisp
<Guest74> they said structure, so I'm not sure they're talking about defclass and friends
<shka> well, :include
<aun> Yes talking specifically about structures here
<aun> I mean, say I m making a deep copy function and you have an array of structs declared as type A. But in fact they are all B (inherited from A). Would you be okay getting array of exactly A structs, with only slots for A copied?
<shka> anyway, don't worry about that
<Alfr> aun, if your users can somehow get hold of an instance of your structure, then you can't.
<shka> aun: "this struct was no designed for :include, don't do that, even it's name is not exported from the package (hint-hint)" as a documentation should suffice
<aun> Okay
<Alfr> aun, say, x it such an instance. Then (type-of x) gives you the structure name symbol, then the user may save that and reuse it in a defstruct form ...
<Guest74> which doesn't work for uninterned symbols.  But i don't think anyone is listening.
triffid has joined #commonlisp
<random-nick> I don't think efficiency concerning struct inheritance is a big deal
<shka> Guest74: what you suggest is... uh... unusual
<shka> your methods confuse and frighten me sir
<Guest74> what they're asking is unusual.
<shka> that as well
kevingal has quit [Remote host closed the connection]
<random-nick> since it's single inheritance only, implementations can probably just include the entire superclass struct at the beginning of the new structure
<random-nick> which helps with readers and writers
<Alfr> Guest74, why wouldn't that work?
<Guest74> I dunno, but it doesn't work on sbcl.
<semz> It does work, but you have to go through pretty awkward eval/#. contortions to get the uninterned symbol into the defstruct form.
cosimone has joined #commonlisp
<Alfr> Guest74, directly writing #:g... won't work, but (eval (let ((name (type-of x))) `(defstruct (foo (:include ,name)) ..))) certainly works for me.
<Alfr> semz, it isn't that bad.
<semz> the one I came up with was awkward :-)
<Alfr> semz, also an appropriate macro can make the eval go away, I think.
abrantesasf has joined #commonlisp
Guest491241242 has joined #commonlisp
Dynom has quit [Quit: WeeChat 3.4]
yewscion has joined #commonlisp
nature has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
hobo_ has joined #commonlisp
hobo has quit [Ping timeout: 272 seconds]
aun has quit [Quit: Client closed]
McParen has left #commonlisp [#commonlisp]
abrante42 has joined #commonlisp
hobo_ has quit [Ping timeout: 256 seconds]
abrantesasf has quit [Ping timeout: 256 seconds]
hobo has joined #commonlisp
Catie has quit [Quit: switching clients]
Catie has joined #commonlisp
alvaro121 has joined #commonlisp
alvaro121_ has quit [Ping timeout: 272 seconds]
hobo has quit [Ping timeout: 256 seconds]
aeth_ has joined #commonlisp
aeth has quit [Killed (NickServ (GHOST command used by aeth_))]
aeth_ is now known as aeth
rogersm has joined #commonlisp
mrcom has joined #commonlisp
wacki has quit [Quit: Leaving.]
lottaquestions_ has quit [Remote host closed the connection]
lottaquestions_ has joined #commonlisp
dra has joined #commonlisp
<random-nick> how come the standard doesn't use the term immediate for objects without guarantees for identity? it's not in the glossary and on pages for functions such as EQ it uses "characters and numbers" to refer to immediates
<random-nick> is that term newer than the standard?
<mrcom> Are you seeing immediate used somewhere else in relation to CL?
dre has quit [Ping timeout: 250 seconds]
<random-nick> yes, I usually hear that used for objects of classes on which EQ is undefined (characters and numbers)
<mrcom> I can kind of see the analogy, but the term brings to my mind a situation where instructions and data are combined.
<mrcom> Pondering...
rgherdt has quit [Remote host closed the connection]
<moon-child> random-nick: to me, 'immediate' indicates an implementation strategy where objects are not accessed indirectly
<moon-child> (in this context. mrcom's definition is also valid, in other context)
<moon-child> this is orthogonal to the question of whether EQ is guaranteed to behave consistently. For instance, I would not expect bignums to be represented immediately, but they are still numbers
<moon-child> in particular, the case in which EQ would be most likely to behave inconsistently is _not_ with immediate values, but with allocated values which are copied
dre has joined #commonlisp
<moon-child> for example, imagine a stack-allocated bignum, one pointer to which is changed to point at an on-heap copy because it is escapes; the implementation optimistically stack allocates because the path where it escapes is unlikely
<moon-child> for immediates, there is nothing to copy except the value itself, so EQ would be more likely to behave consistently
<moon-child> s/it is/it/
<moon-child> s/unlikely/\1 to be taken/
pve has quit [Quit: leaving]
cosimone has quit [Read error: Connection reset by peer]
cosimone has joined #commonlisp
Inline has quit [Read error: Connection reset by peer]
<mrcom> PG's "Common Lisp" calls it "characters and numbers," too. Doesn't even discuss the difference between EQ and EQL until page 228.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
shka has quit [Ping timeout: 256 seconds]
<mrcom> CL's always been pretty loosey-goosey with types.
<mrcom> Tagged values (immediates) are sniffingly relegated to "implementation detail".
<White_Flame> there's been lisps on 8-bits with 16-bit number size, and so there are no numeric immediates there. Not CL, but the implementation-dependence does make sense for extreme cases
<mrcom> Much more focused on structure and operations. For example, "list" isn't even a type.
Inline has joined #commonlisp
<moon-child> White_Flame: better example: abcl
<White_Flame> does it box all integer sizes?
<moon-child> yes
<random-nick> hmm, that definition of immediate object makes sense
Guest74 has quit [Quit: Connection closed]
<random-nick> but I always thought of it as meaning an object that doesn't follow the usual identity semantics
<random-nick> there are also some implementation-defined immediates, such as SBCL's SAPs afaik
morganw has joined #commonlisp
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
<random-nick> but the link with immediate values in assembly makes the definition of immediate objects as an implementation strategy seem more likely to be what the term means
<mrcom> Well, it applies pretty nicely to "a value immediately contained in a cons cell". I'm just not used to thinking about it with that phrase.
tane has quit [Quit: Leaving]
abrante42 has quit [Read error: Connection reset by peer]
abrantesasf has joined #commonlisp
hobo has joined #commonlisp
Oladon has joined #commonlisp
yewscion has quit [Ping timeout: 256 seconds]