Hi,

1. Here is a bug in evaluation of Magma code

sage: m = Magma()
sage: s = "for i in [1..7] do print i^2+i+1; end for;"
sage: m(s)
...
TypeError: Error evaluating Magma code.
IN:_sage_[5]:=for i in [1..7] do print i^2+i+1; end for;
OUT:
>> _sage_[5]:=for i in [1..7] do print i^2+i+1; end for;
              ^
User error: bad syntax

2. And here is a bug in the pre-parser:

sage: s = """
for i in [1..7] do
    print i^2+i+1;
end for;
"""
sage: s
'\nfor i in (ellipsis_range(1,Ellipsis,7)) do\n        print i^2+i
+1;\nend for;\n'

Similarly:

sage: s = "\
for i in [1..7] do\
    print i^2+i+1;\
end for;"
sage: s
'for i in (ellipsis_range(1,Ellipsis,7)) do        print i^2+i+1;end
for;'

3. Although this is not the sage-support list, I'll ask some
questions:
   a. Is it possible to pass user_config=True to the %magma shell
       as for Magma()?
   b. Where do I find the source code for %magma?
   c.  In the notebook, I don't have the same preprocessing of the
        input.  In both, the sage shell and notebook I would like to
        be able to preprocess  ("=","==") -> (":=","=") and keep the

4. In the notebook, is it desirable to require a %magma at the top
   of every cell in order to interpret a sequence of Magma code as
   such?

Ex.
%magma
x := 1;
for i in [1..7] do
    x +:= i^2+i+1;
end for;

Next cell:

%magma
print x

I expected to remain in %magma mode until executing "quit;"
as in the Sage command-line shell.

5. Instead

%magma
quit

then

%magma
1 + 1;

Gives an error; I think it fails to restart a Magma session.

If any Magma users want to suggest or comment on good ways
to merge Sage and Magma code and port code this would be
helpful.  I have some 10 years worth of integrated code:

http://echidna.maths.usyd.edu.au/~kohel/alg/index.html

and directories of worked examples.   It is not a simple matter
of porting a handful of functions.  Instead I need an means of
working with Magma within Sage, and verifying results in the
two systems as individual functions do get ported or rewritten
in Sage.

--David
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to