[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] Re: 1: %
From: |
Ralf Hemmecke |
Subject: |
[Axiom-developer] Re: 1: % |
Date: |
Wed, 22 Feb 2006 18:04:14 +0100 |
User-agent: |
Mozilla Thunderbird 1.0.6 (X11/20050722) |
if we were to consider implementation details, then descending to the
foam level would suffice :-)
However, I was really thinking of the abstract model -- no
implementation involved yet.
I think you are more of an expert in this business. I am just a poor
mathematician with some programming knowledge. ;-)
| However, this behaviour is exactly, the difference between a constant
| and a nullary function in Aldor.
The difference is not that between a constant and a nullary function
-- btw, anything defined with "==" is a constant in Aldor :-)
Yes. As I said. "y" is constant "y()" is not.
if your nullary function y evaluates to the *same* value for same
argument each time, then it would do just fine.
I agree, but it does not evaluate to the same thing. And Aldor allows
this. I understand that mathematically a constant and a nullary function
is not much of a difference. I would also conceptually agree if we speak
about functional languages where there are no side effects. But Aldor
allows side-effects.
> You won't see any difference.
Except, maybe for the running time if the compiler is not smart enough
to remove
the function call and just replace it with the value.
The real difference in your program is that of *binding time*.
Of course, I agree, that "x" and "y()" can be treated as constants if
"y" where a function in the mathematical sense (returning the same value
for the same input). In that case it is just different "binding time".
But in the example I gave in my previous mail. "y" is not a function
that returns the same value in each invocation. And you don't think that
is a difference?
| Aldor computes the value for x at the time the domain is
| instantiated. So it is constant over the lifetime of the domain
| (unless some dirty tricks change that value). For y it is
| different. That is a function constant. But a constant of type ()->%
| not of type %. Now, of course, if you say "y()", you get something of
| type %. But each time you call y() you might get a differen element of
| %.
|
| I guess, you know all this stuff.
yes, thanks. I'm still puzzled as to why you're collapsing binding time
distinction with constant vs. nullary function.
Maybe, I don't have enough knowledge here. If you could enlighten me,
would be nice...
Ralf
- Re: [Axiom-developer] about Expression Integer, (continued)
- Re: [Axiom-developer] about Expression Integer, Gabriel Dos Reis, 2006/02/20
- Re: [Axiom-developer] about Expression Integer, Ralf Hemmecke, 2006/02/21
- Re: [Axiom-developer] about Expression Integer, Gabriel Dos Reis, 2006/02/21
- [Axiom-developer] 1: %, Ralf Hemmecke, 2006/02/21
- [Axiom-developer] Re: 1: %, Gabriel Dos Reis, 2006/02/21
- [Axiom-developer] Re: 1: %, Gabriel Dos Reis, 2006/02/21
- [Axiom-developer] Re: 1: %, Ralf Hemmecke, 2006/02/22
- [Axiom-developer] Re: 1: %, Gabriel Dos Reis, 2006/02/23
- [Axiom-developer] Re: 1: %, Ralf Hemmecke, 2006/02/22
- [Axiom-developer] Re: 1: %, Gabriel Dos Reis, 2006/02/23
- [Axiom-developer] Re: 1: %,
Ralf Hemmecke <=
- Re: [Axiom-developer] about Expression Integer, Ralf Hemmecke, 2006/02/21
- Re: [Axiom-developer] about Expression Integer, Gabriel Dos Reis, 2006/02/20
- Re: [Axiom-developer] about Expression Integer, Ralf Hemmecke, 2006/02/21
- Re: [Axiom-developer] about Expression Integer, Gabriel Dos Reis, 2006/02/21
- RE: [Axiom-developer] about Expression Integer, Bill Page, 2006/02/20
- Re: [Axiom-developer] about Expression Integer, Ralf Hemmecke, 2006/02/21
- Re: [Axiom-developer] about Expression Integer, Ralf Hemmecke, 2006/02/21
- RE: [Axiom-developer] about Expression Integer, Bill Page, 2006/02/21
- Re: [Axiom-developer] about Expression Integer, Ralf Hemmecke, 2006/02/21
- RE: [Axiom-developer] about Expression Integer, Bill Page, 2006/02/21