ID:1279907
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
proc/add(a = 0, b = 0)
return a + b



Outputs this bytecode:
/proc/add
file "test.dm"
line 7
get arg<1>
push null
eq
pop
cjmp 21
line 6
push 0
set arg<1>
get arg<2>
push null
eq
pop
cjmp 36
push 0
set arg<2>
line 7
get arg<1>
get arg<2>
add
retval

(Also note the bugged line numbers, function starts at line 6)
It doesnt even use isnull (I'm fairly sure isnull is an instruction, but it isnt on my list)

Can these be improved to be inside the defvars array if they fit in a 5 byte value specifier? They're just null there right now
isnull is in stdef.dm as a define, pretty sure. probably something like... #define isnull(x) (x ? 1 : 0)
In response to FIREking
FIREking wrote:
isnull is in stdef.dm as a define, pretty sure. probably something like... #define isnull(x) (x ? 1 : 0)

I dumped the 3 std includes I could find, I couldent find isnull defined anywhere
In response to FIREking
FIREking wrote:
isnull is in stdef.dm as a define, pretty sure. probably something like... #define isnull(x) (x ? 1 : 0)

wut. no it's not.
In response to Super Saiyan X
Super Saiyan X wrote:
FIREking wrote:
isnull is in stdef.dm as a define, pretty sure. probably something like... #define isnull(x) (x ? 1 : 0)

wut. no it's not.

My bad, I thought if it wasn't "found" that it would be in stdef.dm
In response to FIREking
isnull(x) is just "x == null".