Class: Rlang

Inherits:
Object show all
Defined in:
lib/rlang/lib/rlang.rb

Defined Under Namespace

Modules: Parser

Class Method Summary collapse

Class Method Details

.initObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rlang/lib/rlang.rb', line 13

def self.init
  # WASI init: setup ARGC, ARGV, etc...
  errno = WASI.init

  # IO init: setup fd of stdin, out and err
  # This code cannot be executed within io.rb
  # as STDxxx can only be used after io.rb is
  # compiled
  STDIN.fd  = WASI::STDIN_FD
  STDOUT.fd = WASI::STDOUT_FD
  STDERR.fd = WASI::STDERR_FD
  $stdin  = STDIN
  $stdout = STDOUT
  $stderr = STDERR
  errno
end