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

Re: case sensitivity



i agree with james in principle and am considering making a next
release around this capability.  i think it would actually be fine to
not support a type mapping scheme but instead provide/document the
basic box/unboxers AND to support goo variable references within the
inlined C code.  james' first example would then become:

  (df example (my-num|<int> my-str|<str>)
     (def result|<int> 0)
     (c-inline (r"""
       sprintf("foo %d %s", Piu($my-num), Psu($my-str)); 
       $my-num = Pib(Piu($my-num)+1);
       $result = Pib(5);""")))

where $xxx refers to xxx in the nearest goo environment and would run
a goo tokenizer to find the end of the token.  

there are a couple improvements that come to mind:

1. an automatic unboxing facility (and perhaps syntactic sugar) that
   unboxes based on goo runtime types avoiding the need for type
   specific unboxers, and

2. a terser syntax for inlining (perhaps #{ }).

i think that this would make a pretty easy to implement and to
reasonably easy to use lightweight c-ffi facility.

jonathan