axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] No-String


From: Vanuxem Gregory
Subject: Re: [Axiom-developer] No-String
Date: Sun, 10 Dec 2006 17:47:04 +0100

Hello Ralf,

The String type and some others are "primitive" types. All is done by
the interpreter so you can not modify this without modifying the
interpreter. The interpreter has to know some of theses primitive types
when it parses and interprets what you're typing. For example if you
type '1.3' (integer dot integer) it returns by default a Float but this
string is first tokenized and after "Floatized" by the interpreter (it
calls float$Float by default). Some values (default types) are assigned
to variables in the interpreter, in your example the variable |$String|
($String in the boot language) holds the default type of strings
(something enclosed in double quote probably). So if you modify this
variable you'll change the default type of strings. You can test it if
you want with:

)lisp (setq |$String| '(|MyString|))

And the default type of strings will be MyString. But in fact don't do
that. This "knowledge" is shared, the interpeter and the spad compiler
use it and after this modification the spad compiler, for example, no
longer "understands" what a string is. The cause of this is may be the
fact that in the code these variables ($String, $Integer etc...) are not
always used, sometimes a default type is directly used. All these things
need to be cleaned up I think.

As far as I know only one default type can be modified, the default type
for floating point numbers. If you issue in the interpreter:

)boot $useBFasDefault:=false

or in Lisp

)lisp (setq |$useBFasDefault| nil)


The default type for floating point numbers will be DoubleFloat (for the
interpreter and the spad compiler) but, as you see, you can not choose
the type.

Greg


Le samedi 09 décembre 2006 à 22:33 +0100, Ralf Hemmecke a écrit : 
> Hello,
> 
> Since Axiom does not understand domains that are extended via Aldor, I 
> had to use another name. So now I have an ACString (defined in a .as 
> file) which has the same exports as String + some additional ones. In 
> fact, I don't need to see String anymore on the Axiom command line.
> 
> I'd like to have that typing
> 
> s := "I am a string"
> 
> returns s of type ACString and not of type String.
> 
> Of course,
> 
> s: ACString := "blah"
> 
> already works, but the problem is
> 
> l: ACList(ACString) := ["a", "b"]
> 
> Any help to "unexpose" String, Integer, SingleInteger, MachineInteger, 
> and Character is very much appreciated.
> 
> Thank you
> Ralf
> 
> 
> 
> _______________________________________________
> Axiom-developer mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/axiom-developer
> 





reply via email to

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