Aldor has generators:
The Aldor/Axiom interface provides such a generator for the Axiom Vector type. Let's try it. More space? I am not sure why but it seems that I must increase GCL memory allocation to make this work. \begin{axiom} )lisp (si::allocate-contiguous-pages 1500 t) )lisp (si::allocate 'sfun 50 t) \end{axiom} \begin{aldor} #include "axiom" myList(v:Vector Integer):List Integer == [ i for i in v ]; \end{aldor} \begin{axiom} V:Vector Integer:=[1,2,3] myList(V) \end{axiom} Space left? \begin{axiom} )lisp (room) \end{axiom} Re: aldor stream oddities --Bill Page, Thu, 09 Aug 2007 10:53:09 -0500 reply On Aug 9, 2007 10:07 AM Franz Lehner wrote:
Hello, is there a way to get hold of ================================================= #include "axiom" teststream: with { zerostream:()->Stream Integer; } == add { zerostream():Stream Integer == { import from Integer; generate((x:Integer):Integer +-> 0@Integer,0@Integer); } } ================================================= aldor -Fasy -Fao -Flsp -laxiom -DAxiom -Y/home/lehner/usr/local/lib/wh-sandbox_s1/target/x86_64-unknown-linux/algebra test1.as "test1.as", line 8: generate((x:Integer):Integer +-> 0@Integer,0@Integer); .........................^ [L8 C26] #1 (Error) Have determined 1 possible types for the expression. Meaning 1: (x: Integer) -> Integer, Integer The context requires an expression of type Stream(Integer). make: *** [test.ao] Fehler 1 ========================================================= #include "axiom" teststream: with { zerostream:()->Stream Integer; } == add { zerostream():Stream Integer == { import from Integer; generate(():Integer +-> 0@Integer); } } ========================================================= aldor -Fasy -Fao -Flsp -laxiom -DAxiom -Y/home/lehner/usr/local/lib/wh-sandbox_s1/target/x86_64-unknown-linux/algebra est2.as Program fault (segmentation violation).#3 (Error) Program fault (segmentation violation). "test2.as", line 6: zerostream():Stream Integer == { .......................................^ [L6 C40] #1 (Error) Have determined 0 possible types for the expression. Subexpression `import from Integer': Meaning 1: (0 types) "test.as", line 9: generate(():Integer +-> 0@Integer); .........................^ [L9 C26] #2 (Error) Have determined 0 possible types for the expression. make: *** [test.ao] Fehler 1 Bill Page replied: Here is one way. The important thing is to escape the keyword
\begin{aldor} #include "axiom" teststream: with { zerostream:()->Stream Integer; } == add { zerostream():Stream Integer == { import from Integer; _generate((x:Integer):Integer +-> 0@Integer,0@Integer); } } \end{aldor} \begin{axiom} zerostream() \end{axiom} Some or all expressions may not have rendered properly, because Axiom returned the following error: Error: export FRICAS=/usr/local/lib/fricas/target/x86_64-unknown-linux; export ALDORROOT=/usr/local/aldor/linux/1.1.0; export PATH=$ALDORROOT/bin:$PATH; export HOME=/var/zope2/var/LatexWiki; ulimit -t 600; export LD_LIBRARY_PATH=/usr/local/lib/fricas/target/x86_64-unknown-linux/lib; LANG=en_US.UTF-8 $FRICAS/bin/FRICASsys < /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/1160129980351370747-25px.axm /bin/sh: /usr/local/lib/fricas/target/x86_64-unknown-linux/bin/FRICASsys: not found Some or all expressions may not have rendered properly, because Latex returned the following error: This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) \write18 enabled. %&-line parsing enabled. entering extended mode (./6559809022419235011-16.0px.tex LaTeX2e <2005/12/01> Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, arabic, farsi, croatian, ukrainian, russian, bulgarian, czech, slov ak, danish, dutch, finnish, basque, french, german, ngerman, ibycus, greek, mon ogreek, ancientgreek, hungarian, italian, latin, mongolian, norsk, icelandic, i nterlingua, turkish, coptic, romanian, welsh, serbian, slovenian, estonian, esp eranto, uppersorbian, indonesian, polish, portuguese, spanish, catalan, galicia n, swedish, ukenglish, pinyin, loaded. (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2005/09/16 v1.4f Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size12.clo)) (/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty (/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def)) (/usr/share/texmf-texlive/tex/latex/base/inputenc.sty (/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def)) (/usr/share/texmf-texlive/tex/latex/bbm/bbm.sty) (/usr/share/texmf-texlive/tex/latex/jknapltx/mathrsfs.sty) (/usr/share/texmf-texlive/tex/latex/base/fontenc.sty (/usr/share/texmf-texlive/tex/latex/base/t1enc.def)) (/usr/share/texmf-texlive/tex/latex/pstricks/pstricks.sty (/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.tex `PSTricks' v1.15 <2006/12/22> (tvz) (/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.con)) (/usr/share/texmf/tex/latex/xcolor/xcolor.sty (/etc/texmf/tex/latex/config/color.cfg) (/usr/share/texmf-texlive/tex/latex/graphics/dvips.def) (/usr/share/texmf-texlive/tex/latex/graphics/dvipsnam.def))) (/usr/share/texmf-texlive/tex/latex/graphics/epsfig.sty (/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty) (/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty (/usr/share/texmf-texlive/tex/latex/graphics/trig.sty) (/etc/texmf/tex/latex/config/graphics.cfg)))) (/usr/share/texmf-texlive/tex/latex/pst-grad/pst-grad.sty (/usr/share/texmf-texlive/tex/generic/pst-grad/pst-grad.tex (/usr/share/texmf-texlive/tex/latex/xkeyval/pst-xkey.tex (/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty (/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.tex))) `pst-plot' v1.05, 2006/11/04 (tvz,dg,hv))) (/usr/share/texmf-texlive/tex/latex/pstricks/pst-plot.sty (/usr/share/texmf-texlive/tex/generic/pstricks/pst-plot.tex v97 patch 2, 1999/12/12 (/usr/share/texmf-texlive/tex/generic/multido/multido.tex v1.41, 2004/05/18 <tvz>))) (/usr/share/texmf-texlive/tex/latex/geometry/geometry.sty (/usr/share/texmf-texlive/tex/xelatex/xetexconfig/geometry.cfg) |