Example #1
0
def NewLoopWord((stack, dictionary)):
    '''
    This command takes all the items on the stack and puts them into a
    tuple with the Loop Handler function in front of them.

    A Loop consumes the top item on the stack, then depending on it's
    "truth" either runs the commands in its tuple and repeats if it's
    true or stops looping altogether if it's false.

    Put the first command to run on the stack first, then the second, and
    so on, so that the last item to run is on the top of the stack when
    you run this command.
    '''
    words = tuple(reversed(list(iterStack(stack))))
    loop = (handle_loop, ) + words
    return (loop, ()), dictionary
Example #2
0
def NewSeqWord((stack, dictionary)):
    '''
    This command takes all the items on the stack and puts them into a
    tuple with the Sequence Handler function in front of them.

    The items on the stack should all be commands from the dictionary,
    either functions or combo commands.  You get these by using the
    "lookup" command on the names of the functions you want.

    Put the first command to run on the stack first, then the second, and
    so on, so that the last item to run is on the top of the stack when
    you run this command.
    '''
    words = tuple(reversed(list(iterStack(stack))))
    seq = (handle_sequence, ) + words
    return (seq, ()), dictionary
Example #3
0
def NewLoopWord((stack, dictionary)):
    '''
    This command takes all the items on the stack and puts them into a
    tuple with the Loop Handler function in front of them.

    A Loop consumes the top item on the stack, then depending on it's
    "truth" either runs the commands in its tuple and repeats if it's
    true or stops looping altogether if it's false.

    Put the first command to run on the stack first, then the second, and
    so on, so that the last item to run is on the top of the stack when
    you run this command.
    '''
    words = tuple(reversed(list(iterStack(stack))))
    loop = (handle_loop,) + words
    return (loop, ()), dictionary
Example #4
0
def NewSeqWord((stack, dictionary)):
    '''
    This command takes all the items on the stack and puts them into a
    tuple with the Sequence Handler function in front of them.

    The items on the stack should all be commands from the dictionary,
    either functions or combo commands.  You get these by using the
    "lookup" command on the names of the functions you want.

    Put the first command to run on the stack first, then the second, and
    so on, so that the last item to run is on the top of the stack when
    you run this command.
    '''
    words = tuple(reversed(list(iterStack(stack))))
    seq = (handle_sequence,) + words
    return (seq, ()), dictionary
Example #5
0
def NewEnstackener((stack, dictionary)):
    stack = list(iterStack(stack))
    stack.append(enstacken)
    stack = tuple(reversed(stack))
    return (stack, ()), dictionary
Example #6
0
def NewEnstackener((stack, dictionary)):
    stack = list(iterStack(stack))
    stack.append(enstacken)
    stack = tuple(reversed(stack))
    return (stack, ()), dictionary