[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Elisp printer
From: |
Tom Tromey |
Subject: |
Re: Elisp printer |
Date: |
Tue, 07 Mar 2017 23:35:45 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
>>>>> "Stefan" == Stefan Monnier <address@hidden> writes:
>> I was wondering about this a while ago and thinking that maybe it could
>> be done without C changes by repurposing the extra arguments to
>> make-byte-code. The idea here would be to let cl-defsubst take a new
>> :type argument other than 'vector or 'list, meaning "use
>> make-byte-code"; and set the :initial-offset to skip over the stuff
>> necessary for the bytecode.
Stefan> Yes, that can be done fairly easily. But that doesn't give you
Stefan> callable functions: it just gives you structs represented by
Stefan> those special "compiled-function" vectors.
What I forgot to mention is that this would be coupled with a slot in
the base class that holds the function to "actually call", and the
underlying call to make-byte-code would install some bytecode that would
simply funcall whatever is in this slot, maybe passing in the object as
a first argument.
I'm not 100% sure this addresses what you're looking for; if not I'd
appreciate it if you could explain more.
One thing I note is that this doesn't provide the "sugar" of being able
to refer to slots using their bare name, you'd have to use accessors.
I'm not sure that this omission is so bad, but maybe make-thunk could
wrap the body of the generated function in some cl-symbol-macrolet forms
Tom
- Elisp printer (was: bug#25295: Represent eieio objects using object-print in backtraces and edebug), Michael Heerdegen, 2017/03/02
- Re: Elisp printer, Tom Tromey, 2017/03/07
- Re: Elisp printer, Lars Brinkhoff, 2017/03/08
- Re: Elisp printer, Stefan Monnier, 2017/03/08
- Re: Elisp printer, Lars Brinkhoff, 2017/03/09
- User-defined record types, Lars Brinkhoff, 2017/03/14
- Re: User-defined record types, Lars Brinkhoff, 2017/03/14
- Message not available
- Message not available
- Re: User-defined record types, Lars Brinkhoff, 2017/03/14
- Re: User-defined record types, Lars Brinkhoff, 2017/03/14
- Re: User-defined record types, Stefan Monnier, 2017/03/14
- Re: User-defined record types, Lars Brinkhoff, 2017/03/14