Nand2Tetris Questions and Answers Forum
›
Compiler
›
Project 11
Search
everywhere
only in this topic
Advanced Search
the difference between 'null' and 'false' ?
Classic
List
Threaded
♦
♦
Locked
3 messages
nozer0
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
the difference between 'null' and 'false' ?
If I convert these terms from 'jack' to 'vm', do they get the same result?
'let a = null'
-> 'push constant 0' 'pop local 0'
'let a = false'
-> 'push constant 0' 'pop local 0'
'let a = 0'
-> 'push constant 0' 'pop local 0'
cadet1620
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: the difference between 'null' and 'false' ?
Administrator
The Jack specification says that "
null
and
false
are mapped to the constant 0."
There should be no difference in the generated VM code whether you use
null
,
false
or
0
.
--Mark
nozer0
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: the difference between 'null' and 'false' ?
Thank you so much
Free forum by Nabble
Edit this page