log outputs nil at the end, bug?
Moderator: MSandro
log outputs nil at the end, bug?
The log commands outpus a nil in a new line after all other argumens, but only if I've started GP in REPL mode. Why? Is this a bug? I am a bit confused.
Re: log outputs nil at the end, bug?
The "nil" you are seeing is probably the return value of whatever expression you evaluated in the REPL. For example:
runs the command "print", which outputs the string 'hello' to the console. Since "print" is a command whose value is discarded when running as a block, it just returns nil. The REPL always prints the return value for any code that you type, so that's why you see "nil".
If you type an express that returns a value other than nil, such as:
You'll just see the result of that expression:
Code: Select all
print 'hello!'
If you type an express that returns a value other than nil, such as:
Code: Select all
join 'hello' ', world!'
Code: Select all
hello, world!