Arc Forumnew | comments | leaders | submitlogin
2 points by bOR_ 6023 days ago | link | parent

Thanks. from this I could figure out the mzscheme version to help my friend out, and for me it hopefully offers me a way for my monkeys to copy behaviour from each other in a way that is still editable (and not just #procedure)

  boris:falcon:~/arc2:rlwrap mzscheme '(+ 5 5)'
  Welcome to MzScheme version 352, Copyright (c) 2004-2006 PLT Scheme Inc.
  > argv
  #1("(+ 5 5)")
  > (vector-ref argv 0)
  "(+ 5 5)"
  > (require (lib "string.ss"))
  > (eval-string i)
  10
  >


3 points by absz 6023 days ago | link

It's probably a better idea to have your monkeys copy code trees around; i.e., rather than having (= monkey1!code "(+ x y)"), have (= monkey1!code (read "(+ x y)")), which is the same as (= monkey1!code '(+ x y)). A scheme like this (if you are careful about what you do with symbols) is a better idea because it's more Lisplike and you can thus take advantage of Lisp's strengths (list manipulation and code-is-data).

-----