On Thu, Aug 6, 2009 at 12:04 AM, Hezekiah M.
Carty<hezekiahca...@users.sourceforge.net> wrote:
> Second, the void* approach may not translate well to other languages.
> I'm not sure if there is a way to do this in C that would translate
> well to the other PLplot-supported languages though.

I want to contribute a couple of points:

void* is not really great even for C because of type safety.  The
compiler cannot check that when you request a double you don't pass a
pointer to an int.

Even if you go with void* for C, you still aren't tied to any approach
for other languages.  For example, for dynamic languages a function
that returns a value (instead of passing a variable by reference)
would better fit into their programming paradigm.  You can:
1. Create wrapper functions for each gettable variable.
2. Create a single wrapper function for all gettable values of a
single type.  Each function will take an enum member and return a
value of some type.

Structs do map to other languages (unlike void*).  But other problems
arise instead.  For example, think about Perl.  Is it Perl-ish to pass
a reference to a hash and get a single value into it?  I don't think
so.  This is just an example, but I guess that same reasoning applies
to other languages.

Dmitri Gribenko

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <griboz...@gmail.com>*/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to