[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-developer] accessing the input function form in Axiom
From: |
Ralf Hemmecke |
Subject: |
Re: [Axiom-developer] accessing the input function form in Axiom |
Date: |
Thu, 23 Oct 2014 10:56:00 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 10/23/2014 10:49 AM, address@hidden wrote:
> Axiom does keep the information you're looking for.
>
> (1) -> f(x) == 3*x^2+5
> Type: Void
> (2) -> )history )show 1
> [1] f(x) == 3*x^2+5
Yes. But as William already said, it's not exported by the function
itself. One has to look elsewhere.
> For more detail about the function you could access foo.axh/index.kaf
> which is a "keyed access file". You could extend GETDATABASE
> which knows how to manipulate .kaf files. The format is (was)
> explained in the source code. Anyway, the foo.axh/index.kaf file:
>
> ------------------------------------------------------------------------
> 335 ("f(x) == 3*x^2+5" (% (|value| (|Void|) . "()"))
> (|f|
> (|value| (|FunctionCalled| |f|) SPADMAP
> (|#1| + (* 3 (^ |#1| 2)) 5))
> (|recursive|) (|alias| |x|) (|isInterpreterFunction| .
> T)
> (|isInterpreterRule|)))
> (("1" 0 20))
> ------------------------------------------------------------------------
>
> where 335 is a byte offset to the dictionary entry list (("1" 0 20))
> which means that user input (1) is 20 bytes into the file
>
> so you seek 20 bytes from the start of the file for the object
> which is a list object whose CAR is the string input you seek.
Yes, I belief that all this is possible, but it sounds like what one can
do in Python, namely look inside an object although it doesn't export
the respective method. I call that cheating and not proper programming.
In other words "cheating" is the default in Mathematica and Maple. I
like Axiom better, because it doesn't allow for easy cheating.
Ralf