[Aldor-l] baselist declarations
Ralf Hemmecke
ralf at hemmecke.de
Mon Jun 23 19:45:40 EDT 2008
Dear Peter,
axlit and axextend say something like
extend Symbol : with {string: Literal -> %;} == add {
string(l: Literal) : % == string(l)$Str::%;
}
For that to compile I would think that a domain with name "Symbol" must
exist.
Now, your original baselist.lsp basically contained what I have
currently in initlist.as.
http://fricas.svn.sourceforge.net/viewvc/fricas/branches/aldor-interface/src/aldor/initlist.as?view=markup
There are only exported declarations of the form
export Symbol: with;
I am wondering why this works. So let's try the follwing three files.
---BEGIN aaa.as
export MySymbol: with;
export Literal: with;
export Type: with;
export Tuple: (T: Type) -> with;
export ->: (S: Tuple Type, T: Tuple Type) -> with;
---END aaa.as
---BEGIN bbb.as
#library AAA "aaa.ao"
import from AAA;
extend MySymbol : with {string: Literal -> %;} == add {
string(l: Literal) : % == never;
}
---END bbb.as
---BEGIN rtexns.as
-- This file is empty.
---END rtexns.as
and compile with
aldor -fo -fao rtexns.as
aldor -fo -fao aaa.as
aldor -fo -fao -fx bbb.as aaa.o rtexns.o
This indeed compiles without error. Of course, that code does nothing.
But how can this work/compile? I extend a domain MySymbol that I don't
define, but only declare as an export. Why am I able to produce an
executable?
So why (for libaxiom.al) is a declaration like
export Symbol: with;
sufficient over a definition
Symbol: with == add;
?
Ralf
More information about the Aldor-l
mailing list