l...@gnu.org (Ludovic Courtès) writes: > Hello, > > The nice thing about SMOBs is that they allow disjoint C types to be > mapped to disjoint Scheme types. > > With ‘(system foreign)’, C pointers are mapped to Scheme foreign > objects, regardless of the type of object pointed to. Thus, to get > disjoint types in Scheme, foreign objects would need to be boxed in > structs (since structs are the only way to create disjoint types from > Scheme). > > If this analysis is correct, the resulting code may be somewhat > inefficient since we end up boxing C pointers twice. > > Is this correct? Thoughts?
Sounds reasonable. Perhaps (system foreign) could add a way of declaring foreign pointer types, and of allowing code to state the type of a pointer at the time of boxing it. Neil