clojush.instructions.vectors

butlaster

(butlaster type)

Returns a function that takes a state and takes the butlast of the top item on the type stack.

concater

(concater type)

Returns a function that takes a state and concats two vectors on the type stack.

conjer

(conjer vec-type lit-type)

Returns a function that takes a state and conj’s an item onto the type stack.

containser

(containser type lit-type)

Returns a function that takes a state and tells whether the top lit-type item is in the top type vector.

emptyvectorer

(emptyvectorer type)

Returns a function that takes a state and pushes a boolean of whether the top vector is empty.

firster

(firster type lit-type)

Returns a function that takes a state and gets the first item from the type stack.

indexofer

(indexofer type lit-type)

Returns a function that takes a state and finds the index of the top lit-type item in the top type vector.

iterateer

(iterateer type lit-type instr)

Returns a function that takes a state and iterates over the type vector using the code on the exec stack. If the vector isn’t empty, expands to: ((first vector) (top-item :exec state) (rest vector) exec_do*vector_type (top-item :exec state) rest_of_program)

laster

(laster type lit-type)

Returns a function that takes a state and gets the last item from the type stack.

lengther

(lengther type)

Returns a function that takes a state and takes the length of the top item on the type stack.

nther

(nther type lit-type)

Returns a function that takes a state and gets the nth item from the type stack.

occurrencesofer

(occurrencesofer type lit-type)

Returns a function that takes a state and counts the occurrences of the top lit-type item in the top type vector.

pushaller

(pushaller type lit-type)

Returns a function that takes a state and pushes every item from the first vector onto the appropriate stack.

removeer

(removeer type lit-type)

Returns a function that takes a state and removes all occurrences of the first lit-type item in the top type vector.

replaceer

(replaceer type lit-type)

Returns a function that takes a state and replaces all occurrences of the second lit-type item with the first lit-type item in the top type vector.

replacefirster

(replacefirster type lit-type)

Returns a function that takes a state and replaces the first occurrence of the second lit-type item with the first lit-type item in the top type vector.

rester

(rester type)

Returns a function that takes a state and takes the rest of the top item on the type stack.

reverser

(reverser type)

Returns a function that takes a state and takes the reverse of the top item on the type stack.

seter

(seter type lit-type)

Returns a function that takes a state and replaces, in the top type vector, item at index (from integer stack) with the first lit-type item.

subvecer

(subvecer type)

Returns a function that takes a state and takes the subvec of the top item on the type stack.

taker

(taker type)

Returns a function that takes a state and takes the first N items from the type stack, where N is from the integer stack.