axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] #pile vs. non-#pile


From: Martin Rubey
Subject: Re: [Axiom-developer] #pile vs. non-#pile
Date: 21 Aug 2006 00:54:30 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

C Y <address@hidden> writes:

> I think Ralf called it - the way to do this is have some kind of
> pretty-printer that can convert between the two.  They are, after all,
> at some level functionally the same.  The difference is just in how we
> (the human programmers) are viewing the logic.
> 
> Eventually, we should have a button on editors that can switch code
> between pile and no-pile with one push.  Then everybody's happy.
> 
> I suppose that's a project in itself though.

Note that a (rudimentary) converter from pile to nopile is included in the
axiom compiler. just say

(1) -> )co test.spad )tr
   Compiling AXIOM source code from file test.spad using old system 
      compiler.
   Warning: translation of an old-style source code ".spad" file to a 
      new-style ".as" file changes the old system compiler. If you wish
      to use the old system compiler for regular compilation, you must 
      exit and re-enter AXIOM.
   Creating output file with name test.as .
#include "axiom.as"
   Compiling AXIOM source code from file test.spad using old system 
      compiler.
   TEST abbreviates package Test 
   compiling exported tst : Integer -> Integer
--)abbrev package TEST Test
No documentation for tst
No documentation for tst

+++ 
Test(): with tst: Integer -> Integer;  == {
        add {
                import from PositiveInteger; 
                import from SingleInteger; 
                import from String; 
                import from OutputForm; 
                import from NoValueMode; 
                tst(n:Integer):Integer == {
                    for (free i) in 1..n repeat {
                        i = 2 => 0; 
                        output(i::OutputForm)$OutputPackage; 
                    }
                    0; 
                }
                
        }
}

Note that it makes many mistakes, but that's probably fixable.

Martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]