special global variables which can be accessed from ractors
Ractors can't access global variables, but some special global variables should be accessed.
There are several types.
(1) Read-only global variables
# process-local (readonly): other commandline parameters '$-p' => $-p, '$-l' => $-l, '$-a' => $-a, # process-local (readonly): getpid '$$' => $$,
(2) scope local variables
# thread local: process result '$?' => $?, # scope local: match '$~' => $~.inspect, '$&' => $&, '$`' => $`, '$\'' => $', '$+' => $+, '$1' => $1, # scope local: last line '$_' => $_, # scope local: last backtrace '$@' => $@, '$!' => $!,
(3) Ractor local variables
# ractor-local (derived from created ractor): debug '$DEBUG' => $DEBUG, '$-d' => $-d, # ractor-local (derived from created ractor): verbose '$VERBOSE' => $VERBOSE, '$-w' => $-w, '$-W' => $-W, '$-v' => $-v, # ractor local: stdin, out, err '$stdin' => $stdin.inspect, '$stdout' => $stdout.inspect, '$stderr' => $stderr.inspect,
I'll merge it soon.
- only accessible from main ractor?
- ARGV, ARGF,
- only accessible from main ractor because they will be obsolete
$, $/ $; $\
- So difficult:
$" / $LOADED_FEATURESand
$: / $LOAD_PATH