I am trying to evaluate some code inside a block in Maxima but it does not seem to be working. If I want have something of the form
block( load("my_file.mac"), do_stuff )
it does not seem to load the file. I wanted to circumvent this problem by defining the only thing I need from that file in the following way
block( "implies"(p, q) := not p or q, infix("implies"), expr: p implies q, do_other_stuff)
But again, I get an error that implies is not an infix operator. I think this is because both load
and infix
have a return value (done
and implies
respectively in my case) which somehow corrupts the block.
It is absolutely necessary that either the entire Maxima code is contained inside a block. So although both
load("my_file.mac"); block(do_stuff)
and
"implies"(p, q) := not p or q; infix("implies"); block(expr: p implies q, do_other_stuff)
work. This is not an option for me.