edu.vub.at.objects.natives
Class OBJSystem

java.lang.Object
  extended byedu.vub.at.objects.natives.NATNil
      extended byedu.vub.at.objects.natives.NATByCopy
          extended byedu.vub.at.objects.natives.OBJSystem
All Implemented Interfaces:
ATAbstractGrammar, ATConversions, ATExpression, ATNil, ATObject, ATStatement, java.io.Serializable

public final class OBJSystem
extends NATByCopy

The sole instance of the class OBJSystem represents the 'system' object, accessible from the lexical root during execution of 'iat'. This object contains various native methods to interface with the shell environment. The interface of the system object is as follows: def system := object: { def argv := the table of extra command-line arguments passed to iat def exit() { quits iat } def print(@objs) { print objects to standard output } def println(@objs) { print objects to standard output, followed by a newline } def read() { read character from standard input } def readln() { read next line from input } def reset() { reset VM into fresh startup state and re-evaluates init and argument file } }

Author:
tvc
See Also:
Serialized Form

Field Summary
private  NATTable argv_
           
 
Fields inherited from class edu.vub.at.objects.natives.NATNil
_INSTANCE_
 
Constructor Summary
OBJSystem(java.lang.String[] argv)
           
 
Method Summary
 ATNil base_exit()
          def exit() { quits iat }
 ATTable base_getArgv()
          def argv := command-line arguments passed to iat
 ATNil base_print(ATObject[] objs)
          def print(@obj) { print obj to standard output }
 ATNil base_println(ATObject[] objs)
          def println(@obj) { self.print(#[@obj, '\n']) }
 ATObject base_read()
          def read() { read character from standard input }
 ATObject base_readln()
          def readln() { read next line from input }
 ATObject base_reset()
          def reset() { reset VM into fresh startup state and re-evaluates init and main file } Resets the global lexical scope to an empty object.
 NATText meta_print()
          Prints out the object in a human-readable way.
 
Methods inherited from class edu.vub.at.objects.natives.NATByCopy
meta_pass, meta_resolve
 
Methods inherited from class edu.vub.at.objects.natives.NATNil
asAmbientTalkObject, asJavaClassUnderSymbiosis, asJavaObjectUnderSymbiosis, asNativeBoolean, asNativeException, asNativeFarReference, asNativeFraction, asNativeNumber, asNativeNumeric, asNativeTable, asNativeText, base__opeql__opeql_, base_asActorMirror, base_asAsyncMessage, base_asBegin, base_asBoolean, base_asClosure, base_asDefinition, base_asExpression, base_asFarReference, base_asField, base_asHandler, base_asMessage, base_asMessageCreation, base_asMethod, base_asMirror, base_asNumber, base_asSplice, base_asStatement, base_asStripe, base_asSymbol, base_asTable, base_asUnquoteSplice, base_asVariableAssignment, base_init, base_isBoolean, base_isCallFrame, base_isClosure, base_isFarReference, base_isMessageCreation, base_isMethod, base_isMirror, base_isSplice, base_isStripe, base_isSymbol, base_isTable, base_isUnquoteSplice, base_isVariableAssignment, base_new, createChild, equals, isAmbientTalkObject, isJavaObjectUnderSymbiosis, isNativeBoolean, isNativeField, isNativeText, meta_addField, meta_addMethod, meta_assignField, meta_assignVariable, meta_clone, meta_defineField, meta_doesNotUnderstand, meta_eval, meta_extend, meta_getDynamicParent, meta_getLexicalParent, meta_getStripes, meta_grabField, meta_grabMethod, meta_invoke, meta_isCloneOf, meta_isRelatedTo, meta_isStripedWith, meta_listFields, meta_listMethods, meta_lookup, meta_newInstance, meta_quote, meta_receive, meta_respondsTo, meta_select, meta_send, meta_share, readResolve, toString, writeReplace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

argv_

private NATTable argv_
Constructor Detail

OBJSystem

public OBJSystem(java.lang.String[] argv)
Method Detail

meta_print

public NATText meta_print()
                   throws InterpreterException
Description copied from interface: ATObject
Prints out the object in a human-readable way.

Specified by:
meta_print in interface ATObject
Overrides:
meta_print in class NATNil
Throws:
InterpreterException

base_getArgv

public ATTable base_getArgv()
def argv := command-line arguments passed to iat

Returns:
a table of ATText values

base_exit

public ATNil base_exit()
def exit() { quits iat }


base_print

public ATNil base_print(ATObject[] objs)
                 throws InterpreterException
def print(@obj) { print obj to standard output }

Throws:
InterpreterException - if obj cannot be converted into a native text value

base_println

public ATNil base_println(ATObject[] objs)
                   throws InterpreterException
def println(@obj) { self.print(#[@obj, '\n']) }

Throws:
InterpreterException

base_read

public ATObject base_read()
                   throws XIOProblem
def read() { read character from standard input }

Returns:
the next character on the input stream, represented by an ATText or nil if EOF has been reached
Throws:
XIOProblem

base_readln

public ATObject base_readln()
                     throws XIOProblem
def readln() { read next line from input }

Returns:
an ATText value denoting the next input line or nil if EOF has been reached
Throws:
XIOProblem - if unable to read from standard input

base_reset

public ATObject base_reset()
def reset() { reset VM into fresh startup state and re-evaluates init and main file } Resets the global lexical scope to an empty object. Re-fills the lobby namespace with the directories on the objectpath. Re-initializes the system object. Re-loads the init file used on startup (user or default init file) Re-loads the -e option or main argument file (if applicable)

Returns:
value of evaluating the main file or -e option; nil if there is no such file or option