|Pliant talk forum
Bug report: Links to types
How can I use a Link:Type to declare variables?
|Message posted by maybe Gordon Matzigkeit on 2002/03/23 14:48:55
|I'd like the following example to work:
gvar Link:Type myInt :> Int
gvar myInt mine := 42
It fails with:
Failed to compile gvar ((Link Type) rw 'mine')
My actual program involves storing a Link:Type as a field in
another type, but I think that if the above simple example
can be made to work, then my program will too.
|Message posted by maybe Hubert Tonneau on 2002/03/23 14:59:09
|gvar constant:myInt mine := 42
Basically 'gvar' requires the type to be known at compile time, so you must
force the expression to be evaluated at compile time through 'constant'
|Message posted by maybe Gordon Matzigkeit on 2002/03/23 15:01:29
|I see that gvar_meta requires a constant type expression. Can
this possibly be changed?
(Also Discution -> Discussion)
|Message posted by maybe Hubert Tonneau on 2002/03/23 15:04:12
|No, because Pliant would not be a full speed dynamic compiler anymore.
If the type of a variable is not known at compile time, then you will end
with the low speed of an interpreter.