>>>>> "Richard" == Richard Fateman <fateman@cs.berkeley.edu> writes:
Richard> I've never used CLISP, but here's what you should
Richard> consider doing.
I can try gcl if you think it is better. I must admit that this is is
the first time I use directly a Lisp interpreter/compiler. The only
previous contact with lisp was through Emacs.
I will try gcl in the next couple of hours and send a reply directly
to you.
Richard> 1. the function tl is in the package mma. try typing
Richard> (in-package :mma) first.
Richard> 2. You probably just want to parse stuff in the file, and
Richard> so using the function ps , actually (mma::ps) is more
Richard> appropriate. for example, (in-package :mma) (ps (open
Richard> "test.ma") );;; result should go to standard output.
Richard> Something is wrong, though.
This is my new trial
*******************CLISP session Begin ***
[1]> (in-package :mma)
#<PACKAGE MMA>
MMA[2]> (ps (open "test.m") )
*** - EVAL: the function PS is undefined
1. Break MMA[3]> (load "init2")
;; Loading file /home/daniel/Mathematica/mma1.6/init2.fas ...
;; Loading of file /home/daniel/Mathematica/mma1.6/init2.fas is finished.
T
1. Break MMA[3]> (ps (open "test.m") )
*** - EVAL: the function PS is undefined
2. Break MMA[4]>
*******************CLISP session End ***
Richard> ;; the file testin.m starts with your example
Richard> DeleteVertex[Graph.... (ps (open "testin.m"))
I must delete the beginning of the file ?? ie
BeginPackage["MyPackage`"]
MyPackage::usage="Do what I want"
>> Sorry, but how can I do this "easily" using Mathematica? I
>> need to add \\FullForm at the end of every line? I could not
>> see a way of translating all the file to FullForm.
Richard> You can do this with expressions, so I assume that if you
Richard> can print a function definition in mathematica somehow,
Richard> you can fullform it too. There is a way of changing the
Richard> output of every line by wrapping it in some function. I
Richard> forget how.
In the huge book of Mathematica I found some ways to do this to
StandardForm and TraditionalForm but not FullForm. In the Preferences
menu we have the same options but no FullForm option.
>> Do you have a list of these changes? With this list, I can
>> provide a Perl script to do this job.
Richard> It would be trivial to do it in lisp, and then wouldn't
Richard> require you to run any other program. I know that perl
Richard> programmers don't believe that anything is easier than
Richard> perl. but lisp is easier here. I don't offhand have a
Richard> list of all the changes, sorry.
As I said before, this is my first adventure with lisp. I am not a
Perl addict but I must admit it is really easy to perform such
regexps substitutions in Perl. If lisp is also easy in this field even
better: I do not need to change my shell or Emacs buffer.