[Aldor-l] better don't type "hello" into that REPL!

Ralf Hemmecke ralf at hemmecke.de
Mon Jun 13 03:47:23 EDT 2005


This is a bug in the documentation. There is an old library (axllib) 
which used to work for it. This library is still distributed with the 
compiler. So if you replace

#include "aldor"

by

#include "axllib"

the code compiles.
However, the documentation should be modified to say something like

-- Figure 2.3: Simple program 3
#include "aldor"

myfactorial(n: Integer): Integer == {
        p :=1;
        for i in 1..n repeat p := p * i;
        p
}

import from Integer, TextWriter, String, Character;
stdout << "factorial 10 = " << myfactorial 10 << newline
-- END Simple program 3

1) Note that I imported from TextWriter, String, and Character. Instead 
of doing this one could also add #include "aldorio" after #include "aldor".

2) In the aldor library the print command is called 'stdout'.

3) The category IntegerType already implements factorial by default. So 
one has to name the function differently, like myfactorial.

Ralf


Alex Goldman wrote:
> What is the state of Aldor? I downloaded it, installed it, and it
> segfaults on the simplest examples from the tutorial (see below).
> 
> Other docs seem to be in disagreement with what they document, e.g.
> "Simple program 3" from
> http://www.aldor.org/docs/HTML/chap2.html simply doesn't compile.



More information about the Aldor-l mailing list