[Top][All Lists]

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

bug#11198: prefab structs in guile

From: Ludovic Courtès
Subject: bug#11198: prefab structs in guile
Date: Thu, 05 Jul 2012 23:55:26 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.1 (gnu/linux)


Andy Wingo <address@hidden> skribis:

>   Since the expression reader can generate prefab instances, they are
>   useful when convenient serialization is more important than
>   abstraction. Opaque and transparent structures also can be serialized,
>   however, if they are defined with define-serializable-struct as
>   described in Datatypes and Serialization.

So I’d be in the ‘define-serializable-struct’ camp, so to speak.

Prefabs raise an number of interesting issues.  For instance, what’s the
meaning of #s(sprout bean #f 17) in a module where ‘sprout’ is unbound?
In a module where it’s bound to a given RTD vs. in a module where it’s
bound to a different RTD?  Does ‘read’ have to be current-module-aware?

This example is a bit scary to me:

    > (define lunch '#s(sprout bean))
    > (struct sprout (kind) #:prefab)
    > (sprout? lunch)                

since it implies that types are compared by name.


reply via email to

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