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.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *