[Aldor-l] Functions and Expression trees

Christian Aistleitner tmgisi at gmx.at
Mon May 8 05:40:24 EDT 2006


Hello,

Willam Naylor wanted to see some demo of how to achieve function name  
grabbing via

> - Aldor's Trace package allows to print the name of a domain (including
> its parameters).


Although I warned that this is terrible stuff, let me provide the  
folloming two files:
eth.as: A helper domain dealing with all the tracing stuff.
ettester.as: Giving a demo how to use this thing.

Compiling (Do not forget the -Wdebug parameter!) to a binary and executing  
yields:
-----------------
Function name: f
Returned Type: AldorInteger
-----------------
Function name: g
Returned Type: MachineInteger
-----------------
Function name: h
Returned Type: --not supplied--

As I said, this is probably not the thing you want, but at least some  
effort in this direction.
Having obtained the String representation of the function name, you can  
easily construct an ExpressionTreePrefix with the desired name.
However, I do not know of a way to "automatically" obtain the parameters  
and their types.
The returned value can be traced, if you need this.


Kind regards,
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eth.as
Type: application/octet-stream
Size: 5618 bytes
Desc: not available
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20060508/c4702963/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ettester.as
Type: application/octet-stream
Size: 1244 bytes
Desc: not available
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20060508/c4702963/attachment-0003.obj>


More information about the Aldor-l mailing list