List of all commands in the V2M-Kernel Vers.0.2.1.07


All following versions with redefined commands including the deprecated commands for two steps of version changing. To find out which version is the next here the numbering schema:

V.E.K.CC
0.2.1.07
| | | |
| | | +-- incremented after corrections are done.
| | +----- incremented after kernel vocabulary changed. CC is cleared (01).
| +------- incremented after virtual engine changed. K, CC are cleared (1).
+--------- Version number, cleared (1) after first stability of E, K and CC.

.

obj -->

Takes an object from the Top Of the Stack (TOS) and prints it to the V2M output stream; by default the console. The dot-command is consumptive, that means the object is taken away from the stack and then printed.

.S


Displays the stack content with TOS at first position in line.

word

--> true str
--> false

Takes the next sequence of characters with no white spaces and puts it as a String onto the Stack followed by a boolean true . If there was no sequence only false is on TOS.

+

num1 num2 --> num
str1 str2 --> str
Adds two numbers and pushes back the sum.
Concatenates str2 to str1 and pushes back the new string.

*

num1 num2 --> num
flg1 flg2 --> flg
Multiplies two numbers and pushes back he product.
Pushes back the conjunction of two booleans.

-

num1 num2 --> num

Pushes back the difference of num1 - num2.

/

num1 num2 --> num

Pushes back the quotient of num1 / num2.

not

int --> int
flg --> flg
Pushes back the 1's complement of an integer.
Pushes back the negation of a boolean.

and

int1 int2 --> int
flg1 flg2 --> flg
Pushes back the bitwise conjunction of two integers.
Pushes back the conjunction of two booleans.

or

num1 num2 --> num
flg1 flg2 --> flg
Pushes back the bitwise disjunction of two integers.
Pushes back the conjunction of two booleans.

=

num1 num2 --> flg
flg1 flg2 --> flg
str1 str2 --> flg
chr1 chr1 --> flg

Pushes back true if the two objects are equal, false otherwise.

<=

num1 num2 --> flg
flg1 flg2 --> flg
chr1 chr1 --> flg

Pushes back true if ob1 less or equal obj2, false otherwise.

<

num1 num2 --> flg
flg1 flg2 --> flg
chr1 chr1 --> flg

Pushes back true if ob1 less obj2, false otherwise.

>

num1 num2 --> flg
flg1 flg2 --> flg
chr1 chr1 --> flg

Pushes back true if ob1 greater obj2, false otherwise.

>=

num1 num2 --> flg
flg1 flg2 --> flg
chr1 chr1 --> flg

Pushes back true if ob1 greater or equal obj2, false otherwise.

<>

num1 num2 --> flg
flg1 flg2 --> flg
str1 str2 --> flg
chr1 chr1 --> flg

Pushes back true if ob1 not equal obj2, false otherwise.

dup

obj --> obj obj

Duplicates the object on top of the Stack

drop

obj -->

Removes the object from top of the Stack

swap

obj1 obj2 --> obj2 obj1

Reverses the order of the two elements on top of the stack.

over

obj1 obj2 --> obj2 obj1 obj2

Copies a double of the object at second stack order to the top.

rot

obj1 obj2 ob3 --> obj3 obj2 obj1

Rotates the elements around the middle element.

:


Starts the compilation of a new secondary. The name is the non spaced character sequence following the colon. A semicolon ; stops the compilation.

varable


Creates a new variable with the name of the following non spaced character sequence.

put

object -->

Stores the object into a variable which name is given by the following non spaced character sequence.

classify

name --> class

Pushes back a class object with the specified name.

instantiate

class -- object

Pushes back an instance of the given class.

field

name object --> field

Makes a field of an instance available for V2M with the name of the following non spaced character sequence. The behavior is same to the variable but type depending.

fetch

name object --> value

Pushes back the content of the named field of an instance.

store

name object value -->

Stores the value in a named field of an object. Similar to put.

method

object name --> method

Makes a method of an instance available for V2M with the name of the following non spaced character sequence.

call

method --> obj

Starts the method. Consumes arguments from stack and pushes back the return value.

creator

name -> creator

Pushes back the creator-method.

build

creator --> object

Calls the creator-method and pushes back the instance.

find

name --> true command
name --> false

Searches for a command with given name and pushes back true and the found command or false if not found.

execute

command -->

Executes the command on stack.

symbol

name --> true symbol
name --> false

Test if the string on stack is a symbol and pushes back true and a symbol or false if not.

type

object --> string

Pushes back the type of an object as string.

(double)

num --> double

Casts the content of any numeric symbol to subengine type double.

(float)

num --> float

Casts the content of any numeric symbol to subengine type float.

(long)

num --> long

Casts the content of any numeric symbol to subengine type long.

(int)

num --> integer

Casts the content of any numeric symbol to subengine type integer.

(short)

num --> short

Casts the content of any numeric symbol to subengine type short.

(byte)

num --> byte

Casts the content of any numeric symbol to subengine type byte.

commands


Gives a list of all existing commands in the vocabulary, starting with the last defined.

forget

name -->

Gets the name of the following non spaced character sequence as a command name and forgets this and all following commands.

load

name -->

Takes the file with the name on stack as new input stream. Continues with origin after file is done.

environment

--> v2m

Pushes back the V2M as an instance of it's own.

newline

--> "\n"

Simply gives a new_line character as a string

if


If true was on stack the commands between if and else or endif are processed.

else


If false was on stack at if-time the commands between else and endif are processed.

endif


Closes a if-else construct.

loop


Start of a loop.

leave


If true is on stack the eaves the loop and continues behind endloop.

endloop


Closes a loop.

exit


Exits the command. Similar to return in normal languages.


Next Version will be 2.2.01, prospective at 07 03 ?? (yy mm dd).

Known changes:

. (dot)

to

write

type

"

typ?

load

"

read


Probably changes:
execute also for methods (cancels call).
instantiate also for special creators (cancels build).