On Sat, May 10, 2025 at 06:30:57PM +0200, Waldek Hebisch wrote:
> On Tue, May 06, 2025 at 10:51:28AM +0200, 'Ralf Hemmecke' via FriCAS - 
> computer algebra system wrote:
> > Unfortunately, interpret_in_new_env does not keep interpreted macros
> > private. :-(
> > 
> > Ralf
> > 
> > %%% (7) ->
> > interpret_in_new_env(parse("xx==>5;yy:=xx+3")$InputForm)$InputForm
> > 
> >    (7)  8
> >                                                         Type:
> > PositiveInteger
> > %%% (8) -> xx
> > 
> >    (8)  5
> >                                                         Type:
> > PositiveInteger
> 
> Actually, already 'parse' causes trouble:
> 
> (1) -> parse("xx==>5;yy:=xx+3")$InputForm
> 
>    (1)  (SEQ /throwAway (LET yy (+ 5 3)))
>                                                               Type: InputForm
> (2) -> xx
> 
>    (2)  5
>                                                         Type: PositiveInteger
> 
> AFAICS fixing this requires rework of macro handling in interpreter.
> I have now version which passes all our tests and gives expected
> result in your example, but it may have significant problems
> (our testsuite tests only a few simple macro uses).

Rework of macro handling has some troubles which will take more
time to resolve.  I have now commited a simple change so that
macros defined during 'parse' do no leak to global enviroment.
Since macros still are expanded during 'parse' it means that
sequence of 'parse' and normal interpret will have no effect
on global macros.

-- 
                              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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/aChxgk5J0LZvWuYh%40fricas.org.

Reply via email to