prefab structs in guile

2012-07-05 Thread Andy Wingo
Hi, We should think about supporting prefab structs in Guile. For more details, see: http://docs.racket-lang.org/guide/define-struct.html?q=prefab#%28part._prefab-struct%29 http://docs.racket-lang.org/reference/structures.html?q=record&q=structs&q=records#(tech._prefab) The reason is that

Re: bug#11198: prefab structs in guile

2012-07-05 Thread Thien-Thi Nguyen
() Andy Wingo () Thu, 05 Jul 2012 10:00:17 +0200 For more details, see: [...] See also (info "(elisp) Byte Packing") which describes Emacs' bindat.el. The context there is network protocols, but the design requirements are the same.

Re: bug#11198: prefab structs in guile

2012-07-05 Thread Andy Wingo
On Thu 05 Jul 2012 15:42, Thien-Thi Nguyen writes: > See also (info "(elisp) Byte Packing") > which describes Emacs' bindat.el. > > The context there is network protocols, > but the design requirements are the same. Interesting. The use cases are a bit different though; much of bindat seems to

Re: scm_to_pointer vs scm->pointer

2012-07-05 Thread Ludovic Courtès
Hi, Andy Wingo skribis: > On Tue 03 Jul 2012 23:47, l...@gnu.org (Ludovic Courtès) writes: > >>> This should be fixed. Otherwise it's impossible to document in any >>> sane fashion. >>> >>> Suggestion: change scm_to_pointer to SCM_POINTER_VALUE. WDYT? >> >> I’m happy with this change. Mark? >

Re: bug#11198: prefab structs in guile

2012-07-05 Thread Ludovic Courtès
Hello, Andy Wingo skribis: > Then you would modify the reader to call out to (ice-9 prefab) with > the list after #s, e.g. the (foo ...) in #s(foo ...). (ice-9 prefab) > would return the record, creating the RTD if needed. The problem with this is that one could precisely forge instances of

Re: bug#11198: prefab structs in guile

2012-07-05 Thread Andy Wingo
On Thu 05 Jul 2012 22:57, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo skribis: > >> Then you would modify the reader to call out to (ice-9 prefab) with >> the list after #s, e.g. the (foo ...) in #s(foo ...). (ice-9 prefab) >> would return the record, creating the RTD if needed. > > Th

Re: bug#11198: prefab structs in guile

2012-07-05 Thread Ludovic Courtès
Hi, Andy Wingo 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-str

Re: bug#11198: prefab structs in guile

2012-07-05 Thread Andy Wingo
On Thu 05 Jul 2012 23:55, l...@gnu.org (Ludovic Courtès) writes: > So I’d be in the ‘define-serializable-struct’ camp, so to speak. That's a valid position to have in general. I can also imagine cases in which you would choose other things. It's a spectrum. > Prefabs raise an number of interes

Re: bug#11198: prefab structs in guile

2012-07-05 Thread Andy Wingo
On Thu 05 Jul 2012 23:55, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo 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 serial

Re: bug#11198: prefab structs in guile

2012-07-05 Thread Ludovic Courtès
Hi, Andy Wingo skribis: > On Thu 05 Jul 2012 23:55, l...@gnu.org (Ludovic Courtès) writes: > >> So I’d be in the ‘define-serializable-struct’ camp, so to speak. > > That's a valid position to have in general. I can also imagine cases in > which you would choose other things. It's a spectrum.