On Sat, Jun 11, 2022 at 12:58:41AM +0200, Ralf Hemmecke wrote:
> Obviously, where in the interpreter is not working as expected, i.e. as in
> the compiler.
>
> x + y where
> macro x == 1
> macro y == 2
>
> I would expect 3, but get
>
> (8) -> )read /tmp/hemmecke/frimacsxGey1q.input
> x + y where
> macro x == 1
> macro y == 2
>
> Line 1: x + y where
> Line 2: macro x == 1
> Line 3: macro y == 2
> ..A.....B....C
> Error A: (from #\A up to #\C) Ignored.
> Error B: Improper syntax.
> 2 error(s) parsing
>
> :-(
Hmm, the following seem to work:
(6) -> x + y where (x == 1; y ==2)
Compiling body of rule x to compute value of type PositiveInteger
Compiling body of rule y to compute value of type PositiveInteger
(6) 3
Type: PositiveInteger
(7) -> f(x) + y where (macro f(t) == sin(t + 1); y ==2)
(7) sin(x + 1) + 2
Type: Expression(Integer)
It seems that interpreter is much more restrictive in 'where' part
compared to Spad compiler. I am not sure if this was intentional
or just a bug/artifact of implementation. I certainly would like
to make Spad and interpreter compatible, and in this case allow
things allowed by Spad compiler.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/20220611033507.GB8376%40fricas.math.uni.wroc.pl.