GameMonkey Script

GameMonkey Script Forums
It is currently Mon Mar 18, 2019 8:12 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Nov 12, 2007 2:35 pm 
Offline

Joined: Fri Nov 24, 2006 9:50 am
Posts: 165
Hi all,

I've been busy again, I've added ?= as a null-detecting one-off assignment, ie. if the variable is a null, the variable is set:

local frog = 5;

frog ?= 10; // only sets frog if it is still a null

print( frog ); // displays 5

I have also added a !! operator to detect for nulls:

if ( !! frog ) { frog = 10; }

is long-hand for the same as the ?= operator above. I had previously implemented this with an isNull global C-function but the overhead for function calls is a little too large so I made it an op-code (BC_OP_ISNULL).


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group