<commit_before>import types, objects, querying, verbs, persist, builtins, rdstdin, strutils, os

var world = createWorld("min")
var root = blankObject()
root.level = 0
world.add(root)
root.owner = root
root.setPropR("name", "root")
root.setPropR("aliases", @[])
root.setPropR("rootprop", "yes")


var genericContainer = root.createChild()
world.add(genericContainer)
genericContainer.setPropR("name", "generic container")
genericContainer.setPropR("contents", @[])

var nowhere = genericContainer.createChild()
world.add(nowhere)

var genericThing = root.createChild()

world.add(genericThing)
genericThing.setPropR("name", "generic thing")

genericContainer.changeParent(genericThing)

var genericRoom = genericContainer.createChild()
world.add(genericRoom)
genericRoom.setPropR("name", "generic room")
genericRoom.setPropR("nexit", genericRoom)
genericRoom.setPropR("eexit", genericRoom)
genericRoom.setPropR("sexit", genericRoom)
genericRoom.setPropR("wexit", genericRoom)
genericRoom.setPropR("uexit", genericRoom)
genericRoom.setPropR("dexit", genericRoom)

var room = genericRoom.createChild()
world.add(room)
room.setPropR("name", "a room")

var genericPlayer = genericThing.createChild()
world.add(genericPlayer)
genericPlayer.setPropR("name", "generic player")

genericPlayer.isPlayer = true

var player = genericPlayer.createChild()
world.add(player)
player.setPropR("name", "the player")

discard player.moveTo(room)

var eval = newVerb(
  names =  "eval",
  owner = root,

  pubRead = true,
  pubWrite = true,
  pubExec = true,

  doSpec = oStr,
  prepSpec = pNone,
  ioSpec = oNone
)
eval.setCode("(try (echo \"=> \" (eval dobjstr)) (echo error))")
world.verbObj.verbs.add(eval)
player.level = 0

createDir(getObjectDir("min"))
world.persist()<commit_msg>Change genericPlayer to a container and fix eval<commit_after>import types, objects, querying, verbs, persist, builtins, rdstdin, strutils, os

var world = createWorld("min")
var root = blankObject()
root.level = 0
world.add(root)
root.owner = root
root.setPropR("name", "root")
root.setPropR("aliases", @[])
root.setPropR("rootprop", "yes")


var genericContainer = root.createChild()
world.add(genericContainer)
genericContainer.setPropR("name", "generic container")
genericContainer.setPropR("contents", @[])

var nowhere = genericContainer.createChild()
world.add(nowhere)

var genericThing = root.createChild()

world.add(genericThing)
genericThing.setPropR("name", "generic thing")

genericContainer.changeParent(genericThing)

var genericRoom = genericContainer.createChild()
world.add(genericRoom)
genericRoom.setPropR("name", "generic room")
genericRoom.setPropR("nexit", genericRoom)
genericRoom.setPropR("eexit", genericRoom)
genericRoom.setPropR("sexit", genericRoom)
genericRoom.setPropR("wexit", genericRoom)
genericRoom.setPropR("uexit", genericRoom)
genericRoom.setPropR("dexit", genericRoom)

var room = genericRoom.createChild()
world.add(room)
room.setPropR("name", "a room")

var genericPlayer = genericContainer.createChild()
world.add(genericPlayer)
genericPlayer.setPropR("name", "generic player")

genericPlayer.isPlayer = true

var player = genericPlayer.createChild()
world.add(player)
player.setPropR("name", "the player")

discard player.moveTo(room)

var eval = newVerb(
  names =  "eval",
  owner = root,

  pubRead = true,
  pubWrite = true,
  pubExec = true,

  doSpec = oStr,
  prepSpec = pNone,
  ioSpec = oNone
)
eval.setCode("""(eval (cat "(try (echo \"=> \" " dobjstr ") (echo \"eval error: \" error))"))""")
world.verbObj.verbs.add(eval)
player.level = 0

createDir(getObjectDir("min"))
world.persist()
{'fraction_non_alphanumeric': 0.14606430155210642, 'fraction_numerical': 0.0011086474501108647, 'mean_word_length': 6.7780172413793105, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1489608', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1180, 'n_words': 249}