axiom-mail
[Top][All Lists]
Advanced

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

Re: [Axiom-mail] Data structure for object definition


From: Gabriel Dos Reis
Subject: Re: [Axiom-mail] Data structure for object definition
Date: 28 Sep 2006 00:36:29 +0200

"Page, Bill" <address@hidden> writes:

| Gaby, 
| 
| On Wednesday, September 27, 2006 4:11 PM you wrote:
| > 
| >   Is there an accessible algebra in Axiom that holds the
| > internal representation of Axiom object?
| >
| 
| I suppose that depends on what you mean by "accessible" and
| "algebra" :) Certainly everything in Axiom has a type but
| many of these types are not "domains" so they do not really
| have an "algebra" in the sense in which I think you mean it.
| In many cases we do not even have a notion of equality.

OK.

| > Assume, I have
| > 
| >      (x:% - %:y):% == reduc(x -$Rep y, commonk(x, y))
| > 
| > Who to I get hold on the internal representation of "-"?
| > 
| > (SEX an EXPR do not see, to give me  what I want).
| > 
| 
| "-" is a function presumably of type ((Rep,Rep) -> Rep) from
| the built-in Mapping domain constructor. Mapping does provide
| some limited "algebraic" properties.
| 
| Is this something like what you want?
| 
| (1) ->  m:= _-$Integer
| 
|    There is more than one - in the domain or package Integer . The one
|       being chosen has type ((Integer,Integer) -> Integer) .
| 
|    (1)  theMap(INT;-;3$;38,126)
|         Type: ((Integer,Integer) -> Integer)
| 
| (2) -> m(1,2)
| 
|    (2)  - 1
|         Type: Integer
| 
| (3) -> typeOf(m)
| 
|    (3)  ((Integer,Integer) -> Integer)
|         Type: Domain
| 
| (4) ->  n:=(_-)$Integer
|    There is more than one - in the domain or package Integer . The one
|       being chosen has type ((Integer,Integer) -> Integer) .
| 
|    (4)  theMap(INT;-;3$;38,126)
|    Type: ((Integer,Integer) -> Integer)
| 
| (5) -> (m=n)::Boolean
| 
|    Loading C:/Program Files/axiom/mnt/windows/algebra/EQ.o for domain
|       Equation
| 
|    (9)  true
|    Type: Boolean
| 
| (6) ->  p:=(_+)$Integer
| 
|    (6)  theMap(INT;+;3$;37,126)
|    Type: ((Integer,Integer) -> Integer)
| 
| (7) -> (m=p)::Boolean
| 
|    (7)  false
|    Type: Boolean
| 
| ---------
| 
| Of course this is in the Axiom interpreter and your example
| suggests you are talking about SPAD code. 

Yes, I'm talking of SPAD code.  Basically, given a SPAD file, I
would like to have the code it contains (category, domain, package
declarations) in form of Axiom data type that I can manipulate work
with.  What is in INFORM seems too primitive for my needs.

| The reflection
| 'typeOf' is not available in SPAD as far as I know and is
| not of much use in the interpreter. It's nice to see however
| that at least Mapping provides an equality and this I am
| sure you can exploit in SPAD and Aldor.

Thank you for the tip.  Basically, I would be very happy if I can have
access to function bodies, type definitions.

| You might also be able to resort to some "tricks" at the
| level of Lisp or would you prefer to avoid that?

If I can avoid it, that would be great.  Otherwise, I would like to
minimize the amount of tricks.  

Thanks!

-- Gaby




reply via email to

[Prev in Thread] Current Thread [Next in Thread]