Empty string: Difference between revisions

Content added Content deleted
m (elided a blank line in the task's preamble.)
(Added Quackery.)
Line 2,173: Line 2,173:
return True
return True
</lang>
</lang>

=={{header|Quackery}}==
Quackery does not have variables or assignment. The closest equivalent to variables is its ancillary stacks. ''temp'' is a predefined ancillary stack. Rather than assigning an empty string to a variable, we can create an empty string and move it to ''temp''.

Demonstrated as a dialogue in the Quackery REPL.

<lang Quackery>Welcome to Quackery.

Enter "leave" to leave the shell.

/O> $ "" temp put ( move an empty string to temp )
... temp share ( copy the empty string on temp to the stack )
... $ '' = ( compare the top of stack to an empty string, and replace it with
... 1 (true) if it is an empty string and 0 (false) if it is not. )
... temp take ( move the empty string on temp to the stack )
... $ '' != ( compare the top of stack to an empty string, and replace it with
... 1 (true) if it is not an empty string and 0 (false) if it is. )
...

Stack: 1 0

/O> leave
...

Aloha.</lang>


=={{header|Quite BASIC}}==
=={{header|Quite BASIC}}==