From apinkus at xs4all.nl  Sun Jul 17 20:46:11 2005
From: apinkus at xs4all.nl (Ayal Pinkus)
Date: Sun, 17 Jul 2005 20:46:11 +0200
Subject: [Rd] Computer algebra in R - would that be an idea??
In-Reply-To: <20050717175327.GM26238@wald.ucdavis.edu>
References: <C83C5E3DEEE97E498B74729A33F6EAEC01AD9A2B@DJFPOST01.djf.agrsci.dk>
	<1121429806.42d7a92eb6678@horde.scannet.dk>
	<17111.46789.226240.355911@stat.math.ethz.ch>
	<a06110400befe1c42c158@203.61.56.151>
	<971536df050716033614fd6e77@mail.gmail.com>
	<a06110401beffa70234a8@[10.1.1.4]>
	<670D7252-4A25-4179-AA28-D6974AE9904A@xs4all.nl>
	<x2zmslk2wl.fsf@turmalin.kubism.ku.dk>
	<0EE77E17-94B0-4DDD-A064-4BFD20F52638@xs4all.nl>
	<20050717175327.GM26238@wald.ucdavis.edu>
Message-ID: <584539A3-9004-474F-BC95-46AB47A542B2@xs4all.nl>


Hi,

>
> This looks promising.  Thanks for starting it off
> and being so enthusiastic.
>

It does sound like a fun thing, and I think this will be very little  
work for me.

> Taking a look at the APIs for Perl, Python, R, Tcl, Java, etc.
> would also be good. One thing that all of these provide is
> a specific typedef for an object.  I imagine Yacas does also,
> so rather than returning void *, it would be nicer to
> return that type.
>

Good point to have type safety. But Yacas uses classes. A number will
actually be a different object from a string, but derived from the same
base class. The void* would simply mean a pointer to something
derived from the base class. We can perhaps typedef a YacasObject, to
be a pointer to void. Would that already provide enough safety?

The other option indeed is to allow full access to the internals. For  
this
I would probably need to expose the entire set of header files, not just
the file cyacas.h. To me it feels more elegant to expose just what one
wants to expose, hence the clear API definition. We can export certain
methods of certain classes, so you could actually just call  
LispAtom::New
or LispSubList::New, literally the classes that are already available.

The disadvantage with exposing the full internals is that I would  
basically
be promising that the internals will never change in the future. The API
abstracts away the internals. There are discussions currently going  
on on
changing the representation of the trees internally, to experiment with
different algorithms.

It is a matter of design. I am ok with exposing all the internals,  
but I would
rather not promise that I will not overhaul the internals.

Ayal



[Rd] Computer algebra in R - would that be an idea??
Ayal Pinkus