From now on all variables will be declared with “var” (instead of number, vector, pointer, etc…) Their types will be based on how you use them. And they can change.
Author: tremblin
-
Redoing all the examples is the hardest part
Of releasing BooBoo 3. Normal builtins vs expression ops is fairly straightforward to convert.
-
Additions to random numbers
I seem to have forgotten but I’ve added srand and time: You will have to call this if you want a random seed…
srand (time) -
BooBoo 2.5.2
- Add NULL null pointer constant
- toptr now returns NULL if named variable doesn’t exist
- == and != can now compare pointers
- Remove D3D references, including lost/found_device callbacks
- Add explode to easily name vector elements
-
explode works now
vector v vector_init v 1 2 3 4 5 number a b c d explode v a b c d print "% % % %\n" a b c d ; prints 1 2 3 4 -
BooBoo 3 is a big change
Almost or about half of everything will become an expression operator. Almost any builtin function returning a value will become and expression op. So instead of:
number n vector_get v n 10You do:
number n = n (vector_get v 10)This allows easier inlining for function calls etc.
However not everything will be treated this way. Like vector_add/vector_set/etc remain the same, it’s mainly things returning a value that benefit from it.
-
toptr improvements
toptr will return NULL (a new constant)if the variable doesn’t exist. == and != now support comparing pointers.
This is the new toptr.boo example which checks if the function exists before calling:
number f file_open f "word.txt" "r" string s file_read f s file_close f pointer p = p (toptr s) if (!= p NULL) go nope call `p :go print "NOPE!\n" :nope function foo { print "foo!\n" } function bar { print "bar!\n" } function baz { print "baz!" } -
BooBoo 2.5.1
- Add toptr to turn a string name into a variable/function/label pointer
- Add image_read_texture, image_to_texture and image_update for manipulating pixels directly
- Removed D3D backend
- Add pixfx example demonstrating (poorly, it can be optimised with image_update) image_read_texture/image_to_texture
- Allow non integer for loop increments (typo)
- Fix + expression op when dealing with expressions
-
toptr in BooBoo
The next version of BooBoo will have toptr which gives you a pointer from a string with a variable name in it.
number f file_open f "word.txt" "r" string s file_read f s file_close f call `(toptr s) function foo { print "foo!\n" } function bar { print "bar!\n" } function baz { print "baz!" }Now if word.txt contains “foo”, “bar” or “baz” the appropriate function is called.
-
What Do you think of some cheap reflection?
For example:
number x = x 100 string s = s (varname x) print "%\n" s ; prints "x" = `(tovar s) 777 ; x is now 777
