|
|
last edited 1 year ago by test1 |
1 2 3 | ||
Editor: test1
Time: 2023/09/17 16:14:42 GMT+0 |
||
Note: |
changed: -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} The Aldor/FriCAS interface provides such a generator for the FriCAS Vector type. Let's try it. changed: -#include "axiom" #include "fricas" removed: -Space left? -\begin{axiom} -)lisp (room) -\end{axiom} changed: -'generator' by prefix with '_'. 'generator'. But FriCAS Stream no longer has 'generate' so code below is not needed and does not work. changed: -#include "axiom" #include "fricas"
Aldor has generators:
for v in E.
does not belong to a
generator type, then an implicit call is made to an appropriate
generator function. This is equivalent to writing
for v in generator E.
The Aldor/FriCAS interface provides such a generator for the FriCAS Vector type. Let's try it.
(1) -> <aldor> #include "fricas"
myList(v:Vector Integer):List Integer == [ i for i in v ];</aldor>
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/7106011744705935635-25px001.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options.
Compiling Lisp source code from file ./7106011744705935635-25px001.lsp Issuing )library command for 7106011744705935635-25px001
Reading /var/aw/var/LatexWiki/7106011744705935635-25px001.asy
V:Vector Integer:=[1,2, 3]
(1) |
myList(V)
(2) |
Hello,
is there a way to get hold of generate$Stream
using the aldor compiler?
I spent quite some time until figuring out that generate is probably
a keyword in aldor (I could not check as the aldor site seems to be down)
and this causes strange error messages.
The following two snippets do not work, note that the second leads to a
segfault:
================================================= #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
generator
. But FriCAS Stream no longer has generate
so
code below is not needed and does not work.
#include "fricas"
teststream: with { zerostream:()->Stream Integer; } == add { zerostream():Stream Integer == { import from Integer; _generate((x:Integer):Integer +-> 0@Integer,0@Integer); } }
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/4578529267043810746-25px003.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. "/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/4578529267043810746-25px003.as",line 8: _generate((x:Integer):Integer +-> 0@Integer, 0@Integer); ................^ [L8 C17] #1 (Error) There are no suitable meanings for the operator `generate'.
The )library system command was not called after compilation.
zerostream()
There are no library operations named zerostream Use HyperDoc Browse or issue )what op zerostream to learn if there is any operation containing " zerostream " in its name.
Cannot find a no-argument definition or library operation named zerostream .