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.

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 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 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 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
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 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: 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.