guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #:printer filed in language specification.


From: Zelphir Kaltstahl
Subject: Re: #:printer filed in language specification.
Date: Mon, 20 Sep 2021 08:04:50 +0000

Hi Maxim!

Thank you for your reply!

I do not know how to create such a vtable, what it means to have a vtalbe which
is `<applicable-struct-vtable>` or how to set it for a struct, but I should have
a look at the manual and see, what comes up when searching for vtable.

Regards,
Zelphir

On 9/19/21 2:24 PM, Maxime Devos wrote:
> Zelphir Kaltstahl schreef op zo 19-09-2021 om 12:11 [+0000]:
>> Hi Maxim!
>>
>> Do you know of any simple example anywhere for applicable structs? I might 
>> have
>> another use for them.
> From NEWS in the Guile source code:
>
>   ** Applicable struct support
>
>   One may now make structs from Scheme that may be applied as procedures.
>   To do so, make a struct whose vtable is `<applicable-struct-vtable>'.
>   That struct will be the vtable of your applicable structs; instances of
>   that new struct are assumed to have the procedure in their first slot.
>   `<applicable-struct-vtable>' is like Common Lisp's
>   `funcallable-standard-class'. Likewise there is
>   `<applicable-struct-with-setter-vtable>', which looks for the setter in
>   the second slot. This needs to be better documented.
>
> For a not-very-simple example, see modules/oop/gooops.scm in Guile's source 
> code.
> I don't know any simple examples.
>
> Greetings,
> Maxime.

-- 
repositories: https://notabug.org/ZelphirKaltstahl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]