Skip to content

Instantly share code, notes, and snippets.

@Vaguery
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save Vaguery/a6706bbf31615e096dec to your computer and use it in GitHub Desktop.

Select an option

Save Vaguery/a6706bbf31615e096dec to your computer and use it in GitHub Desktop.
dependency on Clojush interpreter only
(ns lexicase-redux.core)
(use 'midje.sweet
'(clojush interpreter pushstate)
'(clojush.instructions boolean code common numbers random-instructions string char vectors tag zip return input-output))
;; ...
(println (run-push '(1 2 integer_add false true boolean_or "foo bar" string_length) (make-push-state)))
;; prints:
;; #clojush.pushstate.PushState{:exec (), :code nil, :integer (7 3), :float nil, :boolean (true),
;; :char nil, :string (), :zip nil, :vector_integer nil, :vector_float nil, :vector_boolean nil,
;; :vector_string nil, :input nil, :output nil, :auxiliary nil, :tag nil, :return nil,
;; :environment nil, :termination :normal}
;;
;; as expected! (7 = length of "foo bar", 3 = 1+2, true = false OR true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment