NB. globals
NB.
NB. scriptglobals   - names assigned globally in scripts

require 'regex'

NB.*scriptglobals v names assigned globally in scripts
NB. form: scriptglobals files
NB. files is either a single filename or a boxed list of files
NB. returns boxed list of names

scriptglobals=: 3 : 0
dat=. < @ (1!:1)"0 boxopen y.
rx=. rxcomp '([[:alpha:]][[:alnum:]_]*|x\.|y\.|m\.|n\.|u\.|v\.) *=:'
nms=. ; rx&rxall each dat
rxfree rx
/:~ _2 }. each ~. nms
)
