People,
there is something about the file input/output which I do not find
in the Axiom book.
I take the example of a function
inpEvalOut : String -> String -> String
which
* takes name1, name2,
* inputs a string str from the file name1,
* parses str as a program P to interpret,
interprets P, with writing the result to resStr : String,
* outputs resStr to the file name2 and
returns the result resStr.
For example, if the file 1.txt contains the string "20 + 3",
then the call
inpEvalOut "1.txt" "2.txt"
has the result of resStr = "23", together with the side effect of
output of "23" to the file 2.txt.
It is something like this:
inpEvalOut(name1 : String, name2 : String) : String ==
str := inputStringFromFile name1
resStr := parseEvaluateWriteToString str
outputToFile resStr name2
return resStr
(if the Axiom syntax is correct).
There are the following questions.
* What the Axiom library has for the above aimed functions
inputStringFromFile, parseEvaluateWriteToString, outputToFile
?
* (similar as the C standard library)
Has it functions for opening and closing of a file?
Do the above functions for files return the values for the success of
a file operation? (for the user program to process these values).
* If there are not such functions, maybe, to set
)read and )set spool name2 into the body of the function f,
in some way?
First, I tried to input to the dialogue
f(name1 : String, name2 : String) : String == )read 1.input
.
But Axiom reports "Improper syntax" for the position where
")read" starts.
Thank you in advance for your advice,
------
Sergei
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.