slang-users mailing list

[2000 Date Index] [2000 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

foreign references and operator overloading


All,

  I am considering using s-lang to create a command
line interpreter for a quantum computer simulator
that I have developed (http://qdd.sourceforge.net).

  I don't want to get too fancy (the interpreter is
just to make it easy to demo/debug QDD programs)
but I do have a few questions:

  1) I don't want to expose the entrails of the QDD
     data structure to the s-lang user.  Rather, the
     user will see "references" to QDD objects which
     can be passed around, stored in s-lang variables,
     and manipulated using intrinsic functions.  However,
     I don't expect them to be able to do much more with
     them. Do you have a suggestion for implementing
     this "interface"? (If not, I will probably just
     cast the low level references to/from s-lang 
     integers and deal with the issue that way.  Aack!)

  2) I might want to add multi-precision arithmetic
     to my interpreter (probably using GMP).  Again,
     I don't want the s-lang user to know what a
     bignum looks like, but I want to be able to
     manipulate them with intrinsic (as above). However,
     I do want to overload the s-lang numeric operators.
     (It would be nice to cast integer constants to
     bignums, too .. but that may be expecting too
     much).  However, I don't see any explanation
     of how to do this.  The "complex.c" example file
     was not included with the 1.4.2 distribution.

  I look forward to using s-lang (it looks very nice
from what I have seen so far!) and hope appreciate
any help you can provide.

Thanks,

Dave Greve


[2000 date index] [2000 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]