Ralf Hemmecke <[EMAIL PROTECTED]> writes:
> > NO. I provide construct. For axiom, bracket is just any name, but construct 
> > is
> > special: [] is syntactic sugar for construct.
> 
> I see that you use "construct" in AC, but I don't see that you define it. 
> Could
> you point me to the exact place. Or do you actually mean that unnecessary
> function "makeAxiomList"?
<<implementation of String from LibAldor>>=
generator(a: %): Generator ACCharacter == generate {
        import from Integer, NNI, ACCharacter;
        for i in 1..(#a::Integer) repeat yield((a.i)::ACCharacter);
}
bracket(g: Generator ACCharacter): % == {
        import from ACCharacter;        
        l: List Character := [c::Character for c in g];
        coerce construct l;
}
construct(g: Generator ACCharacter): % == bracket g;
empty: % == per empty();
(x: %) + (y: %): % == per concat(rep x, rep y);
string(l: Literal): % == (string(l)$Rep) :: %;
leftTrim(s: %, c: ACCharacter): % == per leftTrim(rep  s, coerce c);
rightTrim(s: %, c: ACCharacter): % == per rightTrim(rep s, coerce c);
@

...


We export an operation \adname{construct} to make the bracket construction work
in the \xAxiom{} interpreter. Note that, for some reason, the bracket still has
to be package called, as in \adcode|[g]$ACList Integer|, %$
otherwise \xAxiom{} crashes\dots.
<<implementation of List from LibAldor>>=
empty: % == per empty();
 #(x: %): I == (# rep x) :: I;
apply(l: %, n: ACMachineInteger): S == apply(l::List S, n::Integer);
set!(l: %, n: ACMachineInteger, s: S): S == { 
        (l::List S).(n::Integer) := s;
}
construct(g: Generator S): % == bracket g;
@


(I try to do this quickly only, because I need to go to bed again)

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Aldor-combinat-devel mailing list
Aldor-combinat-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/aldor-combinat-devel

Reply via email to