[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
non-constant constants was: Re: [Aldor-l] [Axiom-developer] Re: export
From: |
Ralf Hemmecke |
Subject: |
non-constant constants was: Re: [Aldor-l] [Axiom-developer] Re: exports and constants |
Date: |
Sat, 29 Jul 2006 07:43:05 +0200 |
User-agent: |
Thunderbird 1.5.0.5 (X11/20060719) |
Hi Bill,
I turned exports into a function, as you'd probably want to
call it more than once.
I don't understand the relevance of whether exports is a function
or not. As a generator we can use it as often as we like. No?
Try the following piece of code.
---BEGIN aaa14.as
#include "aldor"
#include "aldorio"
main(): () == {
import from Integer, List Integer;
fun(): Generator Integer == generate {
yield 0;
yield 1;
};
const: Generator Integer == fun();
stdout << [fun()] << newline;
stdout << [fun()] << newline;
stdout << [const] << newline;
stdout << [const] << newline;
}
main();
---END aaa14
>aldor -grun -laldor aaa14.as
[0,1]
[0,1]
[0,1]
[]
I agree that const is not constant. But a Generator is inherently
destructive.
If you like you could also say something like
a: Record(x: Integer) == [1];
a.x := 0;
and the "constant" a changes. But you should note that the last line is
actually
set!(a, x, 0)
so that is a destructive function and thus you should expect strange
things. The BANG functions (like set!) are only for people who know what
they do.
Ralf
- RE: [Aldor-l] [Axiom-developer] Re: exports and constants, (continued)
- [Axiom-developer] non-reflection, Ralf Hemmecke, 2006/07/27
- Re: [Aldor-l] [Axiom-developer] Re: exports and constants, Christian Aistleitner, 2006/07/28
- RE: [Aldor-l] [Axiom-developer] Re: exports and constants, Bill Page, 2006/07/28
- Re: [Aldor-l] [Axiom-developer] Re: exports and constants, Christian Aistleitner, 2006/07/29
- Re: [Aldor-l] [Axiom-developer] Re: exports and constants, Ralf Hemmecke, 2006/07/29
- RE: [Aldor-l] [Axiom-developer] Re: exports and constants, Bill Page, 2006/07/29
- non-constant constants was: Re: [Aldor-l] [Axiom-developer] Re: exports and constants,
Ralf Hemmecke <=
- RE: [Aldor-l] non-constant constants was: Re: [Axiom-developer] Re: exports and constants, Bill Page, 2006/07/29
- Re: [Aldor-l] non-constant constants was: Re: [Axiom-developer] Re: exports and constants, Christian Aistleitner, 2006/07/29
- Re: [Aldor-l] non-constant constants was: Re: [Axiom-developer] Re: exports and constants, Ralf Hemmecke, 2006/07/29
- Re: [Aldor-l] [Axiom-developer] Re: exports and constants, Ralf Hemmecke, 2006/07/29
- Re: [Aldor-l] [Axiom-developer] Re: exports and constants, Christian Aistleitner, 2006/07/29
- Re: [Aldor-l] [Axiom-developer] Re: exports and constants, Gabriel Dos Reis, 2006/07/27
- RE: [Aldor-l] [Axiom-developer] Re: exports and constants, Page, Bill, 2006/07/27
- Re: [Aldor-l] [Axiom-developer] Re: exports and constants, Gabriel Dos Reis, 2006/07/27
- RE: [Aldor-l] [Axiom-developer] Re: exports and constants, Page, Bill, 2006/07/27
- Re: [Aldor-l] [Axiom-developer] Re: exports and constants, Gabriel Dos Reis, 2006/07/27