Sha256: fe2acf8d9d026b69ed35c0cf36bf2dc2caf292b947efc9ff1d6b3dde387e8907

Contents?: true

Size: 1.2 KB

Versions: 119

Compression:

Stored size: 1.2 KB

Contents

#!/usr/bin/env apl --script
)COPY 5 FILE_IO.apl

⍝ Clear logfile with given filename.
∇test∆clear_log filename;handle;_
  handle←'w' FIO∆fopen filename
  _←FIO∆fclose handle
∇

⍝ )COPY file relative to current directory.
∇test∆copy_relative path;_
  _←⍎ ')COPY ',test¯pwd,'/',path
∇

⍝ Write logfile with given filename to stderr as UTF-8.
∇test∆show_log filename;cr
  cr←⎕UCS 10
  test¯warn cr,'***** TEST LOG *****',cr,cr
  test¯warn test¯read_unicode filename
∇

⍝ Evaluate APL code (as string).
⍝ Returns 2-element vector:
⍝ [1] Boolean (1 if error, 0 if not).
⍝ [2] Error message if error; original result if not.
∇z←test∆try apl_string;response;is_error;result
  response←⎕EC apl_string
  is_error←0=1⊃response
  result←3⊃response
  →(~is_error)/return
  result←result[1;]
  return: z←is_error result
∇

⍝ private

⍝ Return current directory as a string.
∇pwd←test¯pwd
  pwd←FIO∆getcwd
∇

⍝ Read a UTF-8 file into a Unicode character vector.
∇unicode←test¯read_unicode filename
  unicode←19⎕CR FIO∆read_file filename
∇

⍝ Write string to stderr.
∇test¯warn string;_
  _←FIO∆fprintf_stderr '%s' string
∇

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/gnu-apl/test.apl
trackler-2.2.1.179 tracks/gnu-apl/test.apl
trackler-2.2.1.178 tracks/gnu-apl/test.apl
trackler-2.2.1.177 tracks/gnu-apl/test.apl
trackler-2.2.1.176 tracks/gnu-apl/test.apl
trackler-2.2.1.175 tracks/gnu-apl/test.apl
trackler-2.2.1.174 tracks/gnu-apl/test.apl
trackler-2.2.1.173 tracks/gnu-apl/test.apl
trackler-2.2.1.172 tracks/gnu-apl/test.apl
trackler-2.2.1.171 tracks/gnu-apl/test.apl
trackler-2.2.1.170 tracks/gnu-apl/test.apl
trackler-2.2.1.169 tracks/gnu-apl/test.apl
trackler-2.2.1.167 tracks/gnu-apl/test.apl
trackler-2.2.1.166 tracks/gnu-apl/test.apl
trackler-2.2.1.165 tracks/gnu-apl/test.apl
trackler-2.2.1.164 tracks/gnu-apl/test.apl
trackler-2.2.1.163 tracks/gnu-apl/test.apl
trackler-2.2.1.162 tracks/gnu-apl/test.apl
trackler-2.2.1.161 tracks/gnu-apl/test.apl
trackler-2.2.1.160 tracks/gnu-apl/test.apl