Countdown: 2

World has much to do with dialects. Even World itself is a dialect (in fact several dialects), just like the language, we speak, consists of dialects.

An example in World, where we want to expand the language with an object oriented dialect:

w> do %mezz/object.w
w> obj: object [
    private [a: 1 b: 2]                   ; private data
    public [f: func [v][a + b + v]    ; two public methods, f and set-a
              set-a: func [v][a: v]]
w> help obj      ; notice we can't see A and B
obj is a context! of value:
   f               function! [v]
   set-a         function! [v]

w> obj/f 1       ; calling f inside obj with argument 1
== 4
w> obj/set-a 40
== 40
w> obj/f 0
== 42

World doesn't have keywords, as everything can be redefined. Beside the native functions and datatypes, the virtual machine understands directly, much of the basic part of the language is defined in World/Cortex. The Cortex part is just a World script named "cortex.w". The language is used to define itself and can be expanded into many dialects.

Introducing call-by-word, which can be compared to call-by-reference in other languages:

w> block: [a b c d]
== [a b c d]
w> next block       ; this doesn't change BLOCK
== [b c d]
w> block
== [a b c d]          ; as we can see here
w> next 'block       ; this is call-by-word and changes BLOCK
== [b c d]
w> block
== [b c d]             ; see!

A lit-word! value is recognized by a pre-fixed apostrophe ('). The code generator changes lit-words into words, so the function, NEXT, gets a word in the call-by-word example above.