axiom-developer
[Top][All Lists]

## [Axiom-developer] [#29 for i in 1..1 repeatprint(sin(i) :: Complex Float

 From: Bill Page Subject: [Axiom-developer] [#29 for i in 1..1 repeatprint(sin(i) :: Complex Float)] Date: Tue, 18 Jan 2005 01:23:22 -0600

??changed:
-> -> for i in 1..1 repeat print(sin(i) :: Complex Float)
->    sin(1)

\begin{axiom}
\end{axiom}

\begin{axiom}
for i in 1..1 repeat print(sin(i) :: Complex Float)
\end{axiom}

Note that neither Float nor Complex is loaded in (1), only in (2). More
surprisingly, UniversalSegment is also not loaded in (1). (it does not
matter if the segment is 1..1 or 1..3).

\begin{axiom}
for i in 1..3 repeat print(sin(i)::Complex Float)
for i in 1..3 repeat print(a:=sin(i)::Complex Float)
\end{axiom}

\begin{axiom}

??changed:
-
-all give
-
-0.8414709848 0789650665
\end{axiom}

all give::

0.8414709848 0789650665

\begin{axiom}

for i in 1..1 repeat (a:=sin(i); print(a::Complex Float))
\end{axiom}

Gives:

--removed:
-
-for i in 1..1 repeat (a:=sin(i); print(a::Complex Float))
-
-sin(1)

??changed:
-mathprint$Lisp mathprint\$Lisp

??changed:
-may not be what the interpreter is doing:
-
---%Printest
-)abbrev package PRINTEST Printest
-Printest: T==C where
-  EXPR ==> Expression
-  INT  ==> Integer
-  CF   ==> Complex Float
-  T == with
-       foo:PositiveInteger->Void
-       import EXPR INT
-       foo(k)==
-         for i in 1..k repeat
-           a:=sin(i::INT::Float::CF::EXPR CF)$(EXPR CF) - print(retract(a)$(EXPR CF)@CF::OutputForm)
may not be what the interpreter is doing::

--%Printest
)abbrev package PRINTEST Printest
Printest: T==C where
EXPR ==> Expression
INT  ==> Integer
CF   ==> Complex Float
T == with
foo:PositiveInteger->Void
import EXPR INT
foo(k)==
for i in 1..k repeat
a:=sin(i::INT::Float::CF::EXPR CF)\$(EXPR CF) print(retract(a)\$(EXPR CF)@CF::OutputForm)

??changed:
-----
-Note that neither Float nor Complex is loaded in (1), only in (2). More
-surprisingly, UniversalSegment is also not loaded in (1). (it does not matter
if
-the segment is 1..1 or 1..3).
-
-(1) -> for i in 1..3 repeat print(sin(i)::Complex Float)
-
-   sin(1)
-   sin(2)
-   sin(3)
-                                                                   Type: Void
-(2) -> for i in 1..3 repeat print(a:=sin(i)::Complex Float)
-
-   0.8414709848 0789650665
-   0.9092974268 256816954
-   0.1411200080 598672221 + 0.3388131789 0172013563 E -20 %i
-                                                                   Type: Void
-(3) ->
-[215 more lines...]

--