/usr/share/axiom-20170501/src/algebra/FOP.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | )abbrev package FOP FortranOutputStackPackage
-- Because of a bug in the compiler:
)bo $noSubsumption:=false
++ Author: Mike Dewar
++ Date Created: October 1992
++ Description:
++ Code to manipulate Fortran Output Stack
FortranOutputStackPackage() : SIG == CODE where
SIG ==> with
clearFortranOutputStack : () -> Stack String
++ clearFortranOutputStack() clears the Fortran output stack
showFortranOutputStack : () -> Stack String
++ showFortranOutputStack() returns the Fortran output stack
popFortranOutputStack : () -> Void
++ popFortranOutputStack() pops the Fortran output stack
pushFortranOutputStack : FileName -> Void
++ pushFortranOutputStack(f) pushes f onto the Fortran output stack
pushFortranOutputStack : String -> Void
++ pushFortranOutputStack(f) pushes f onto the Fortran output stack
topFortranOutputStack : () -> String
++ topFortranOutputStack() returns the top element of the Fortran
++ output stack
CODE ==> add
import MoreSystemCommands
-- A stack of filenames for Fortran output. We are sharing this with
-- the standard Fortran output code, so want to be a bit careful about
-- how we interact with what the user does independently. We get round
-- potential problems by always examining the top element of the stack
-- before we push. If the user has redirected output then we alter our
-- top value accordingly.
fortranOutputStack : Stack String := empty()@(Stack String)
topFortranOutputStack():String == string(_$fortranOutputFile$Lisp)
pushFortranOutputStack(fn:FileName):Void ==
if empty? fortranOutputStack then
push!(string(_$fortranOutputFile$Lisp),fortranOutputStack)
else if not(top(fortranOutputStack)=string(_$fortranOutputFile$Lisp)) then
pop! fortranOutputStack
push!(string(_$fortranOutputFile$Lisp),fortranOutputStack)
push!( fn::String,fortranOutputStack)
systemCommand concat(["set output fortran quiet ", fn::String])$String
void()
pushFortranOutputStack(fn:String):Void ==
if empty? fortranOutputStack then
push!(string(_$fortranOutputFile$Lisp),fortranOutputStack)
else if not(top(fortranOutputStack)=string(_$fortranOutputFile$Lisp)) then
pop! fortranOutputStack
push!(string(_$fortranOutputFile$Lisp),fortranOutputStack)
push!( fn,fortranOutputStack)
systemCommand concat(["set output fortran quiet ", fn])$String
void()
popFortranOutputStack():Void ==
if not empty? fortranOutputStack then pop! fortranOutputStack
if empty? fortranOutputStack then push!("CONSOLE",fortranOutputStack)
systemCommand concat(["set output fortran quiet append ",_
top fortranOutputStack])$String
void()
clearFortranOutputStack():Stack String ==
fortranOutputStack := empty()@(Stack String)
showFortranOutputStack():Stack String ==
fortranOutputStack
|