Orca Behavior
Differences from REBOL
Philosophy
While REBOL is touted as a tool for non-technical computer users, Orca is geared slightly more for programmers and there is a greater focus on execution speed.
math type promotion
Division of integers in REBOL will create decimal! if there is a fractional result. This is an unexpected behavior for C programmers. Orca will only return a decimal if at least one input is decimal. This also simplifies the implementation.
random
series! returns position in series rather than mixed up copy. It is more efficient to pick a random element. Could have new 'randomize native to mix a series up.
decimal! returns fractional, zero based values.
When /seed is used then value is the seed and must be an integer!. If seed value is zero then a new clock based seed is used.
poke
REBOL 'poke binary! seems broken in my estimation as it does not accept integer!.
b: #{001102}
poke j 2 #"j" ; This works
poke b 2 3 ; Error: Invalid argument
dirize
REBOL copies the path. Orca does not for efficiency. If you want to copy just 'dirize copy path'
Number Arrays
Added dec-array! and int-array! series datatypes.
These datatypes were added to efficiently read and store large sets of numbers. Many datasets, such as 3D models, consist of large groups of numbers.
#[0 2.23] ; dec-array! (double) i#[0 2 4] ; int-array! ;f#[0 2 4] ; float-array!
Hexidecimal specification of integers
Use $ to declare an integer in hexidecimal format. For example $11 is 17 in decimal.
There will never be a money! datatype in Orca.
To Be Done
These are possible future changes to the language.
first, second overloading
Rather than using functions or members, the index words first, second, etc. are used to access certain datatype features. This is not clear to readers of the code what is happening.
Using structs as an example:
first struct! ; returns spec second struct! ; returns data as block third struct! ; returns data as binary
It might be better to make new natives such as:
struct-spec struct! struct-block struct! struct-binary struct!
This is where object-oriented notation would be useful (e.g. 'x.spec').
current directory
REBOL changes the current directory to where the running script lives. This requires an extra line 'change-dir system/script/parent/path' to get normal command line utility behavior.
Unicode series
Everything else in the computing universe supports unicode these days.
Block comments
C-style /* */ comments which eliminate code from the program. The comment word seems like a hack which increases run-time overhead.
Preprocessor
Define words to be replaced at parse time.
^myflag: 4 print ^myflag ; == 4 type? ^myflag ; == integer!
ieee native
ieee 6.5 = ${0000102}
ieee/d 6.5 = ${000010200112233}
