{"action":"created","comment":{"url":"https://api.github.com/repos/rchain/rchain/pulls/comments/148012608","pull_request_review_id":73009610,"id":148012608,"diff_hunk":"@@ -10,38 +12,149 @@ case object Upcall extends LookupError\n \n trait Base\n \n+//TODO change type of `indirect` argument to bool\n trait Ob extends Base {\n-  val parent: Ob\n   val meta: Ob\n+  val parent: Ob\n   val slot: Seq[Ob]\n   val obTag: ObTag = null\n   val sysval: SysCode = null\n+  val constantP = true\n \n   def dispatch(ctxt: Ctxt): Ob = null\n   def extendWith(keymeta: Ob): Ob = null\n   def extendWith(keymeta: Ob, argvec: Tuple): Ob = null\n-  def getAddr(ind: Int, level: Int, offset: Int): Ob = null\n+\n+  def getAddr(ind: Int, level: Int, offset: Int): Ob = getLex(ind, level, offset) //TODO FIXNUM(ADDR_TO_PRE_FIXNUM _)\n+\n   def getField(ind: Int,\n                level: Int,\n                offset: Int,\n                spanSize: Int,\n-               sign: Int): Ob =\n-    null\n-  def getLex(ind: Int, level: Int, offset: Int): Ob = null\n+               sign: Int): Ob = {\n+\n+    ??? //TODO\n+  }\n+\n+  def getLex(ind: Int, level: Int, offset: Int): Ob = {\n+    val p: Ob = nthParent(level)\n+\n+    actorExtensionFiltered(ind, p)\n+      .map(offsetOrInvalid(offset, _))\n+      .getOrElse(Ob.INVALID)\n+  }\n+\n   def is(value: Ob.ObTag): Boolean = true\n   def lookupOBO(meta: Ob, ob: Ob, key: Ob): Either[LookupError, Ob] =\n     Right(null)\n   def matches(ctxt: Ctxt): Boolean = false\n   def numberOfSlots(): Int = Math.max(0, slot.length - 2)\n   def runtimeError(msg: String, state: VMState): (RblError, VMState) =\n     (DeadThread, state)\n-  def setAddr(ind: Int, level: Int, offset: Int, value: Ob): Ob = null\n+\n+  def setAddr(ind: Int, level: Int, offset: Int, value: Ob): Ob = setLex(ind, level, offset, value) //TODO\n+\n   def setField(ind: Int,\n                level: Int,\n                offset: Int,\n                spanSize: Int,\n-               value: Int): Ob = null\n-  def setLex(ind: Int, level: Int, offset: Int, value: Ob): Ob = null\n+               value: Int): Ob = {\n+    ??? //TODO\n+  }\n+\n+  def setLex(ind: Int, level: Int, offset: Int, value: Ob): Ob = {\n+    val p: Ob = nthParent(level)\n+\n+    actorExtensionFiltered(ind, p)\n+      .filter { _ => offset < p.numberOfSlots() }\n+      .map { ob =>\n+        ob.slot(offset) = value","path":"roscala/src/main/scala/coop/rchain/rosette/Ob.scala","position":null,"original_position":76,"commit_id":"56e7574a4984a41364730397ea7bebe82260755c","original_commit_id":"7693f82362dbf0c8ddab3e8ed1fda1e5298f4b99","user":{"login":"tymm","id":28924,"avatar_url":"https://avatars1.githubusercontent.com/u/28924?v=4","gravatar_id":"","url":"https://api.github.com/users/tymm","html_url":"https://github.com/tymm","followers_url":"https://api.github.com/users/tymm/followers","following_url":"https://api.github.com/users/tymm/following{/other_user}","gists_url":"https://api.github.com/users/tymm/gists{/gist_id}","starred_url":"https://api.github.com/users/tymm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tymm/subscriptions","organizations_url":"https://api.github.com/users/tymm/orgs","repos_url":"https://api.github.com/users/tymm/repos","events_url":"https://api.github.com/users/tymm/events{/privacy}","received_events_url":"https://api.github.com/users/tymm/received_events","type":"User","site_admin":false},"body":"```\r\nimport Lenses._\r\n\r\nob.update(_ >> 'slot)(_.updated(offset, value))\r\n```\r\nIf the data structure is not deeply nested, I think `ob.copy(...)` is fine though.\r\n\r\nThe problem here however is that `ASSIGN(p, slot(offset), val);`/`ob.slot(offset) = value` is a side effects to `this`. Therefore `setLex` needs to return `(Ob, Ob)` or we allow for mutation in `Ob` for now until we figure things out.\r\nI would argue for the latter.\r\n\r\n","created_at":"2017-10-31T14:29:23Z","updated_at":"2017-10-31T14:30:17Z","html_url":"https://github.com/rchain/rchain/pull/35#discussion_r148012608","pull_request_url":"https://api.github.com/repos/rchain/rchain/pulls/35","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments/148012608"},"html":{"href":"https://github.com/rchain/rchain/pull/35#discussion_r148012608"},"pull_request":{"href":"https://api.github.com/repos/rchain/rchain/pulls/35"}},"in_reply_to_id":147743038},"pull_request":{"url":"https://api.github.com/repos/rchain/rchain/pulls/35","id":149412147,"html_url":"https://github.com/rchain/rchain/pull/35","diff_url":"https://github.com/rchain/rchain/pull/35.diff","patch_url":"https://github.com/rchain/rchain/pull/35.patch","issue_url":"https://api.github.com/repos/rchain/rchain/issues/35","number":35,"state":"closed","locked":false,"title":"Add implementation for methods from ROS-183","user":{"login":"DoSOfRedRiver","id":2995220,"avatar_url":"https://avatars1.githubusercontent.com/u/2995220?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSOfRedRiver","html_url":"https://github.com/DoSOfRedRiver","followers_url":"https://api.github.com/users/DoSOfRedRiver/followers","following_url":"https://api.github.com/users/DoSOfRedRiver/following{/other_user}","gists_url":"https://api.github.com/users/DoSOfRedRiver/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSOfRedRiver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSOfRedRiver/subscriptions","organizations_url":"https://api.github.com/users/DoSOfRedRiver/orgs","repos_url":"https://api.github.com/users/DoSOfRedRiver/repos","events_url":"https://api.github.com/users/DoSOfRedRiver/events{/privacy}","received_events_url":"https://api.github.com/users/DoSOfRedRiver/received_events","type":"User","site_admin":false},"body":"The implementation for methods from https://rchain.atlassian.net/browse/ROS-183\r\n\r\nThere are few methods replaced:\r\n- `asCString` replaced in favour to `Show` typeclass;\r\n- `printOn`, `printQuotedOn`, `displayOn` now depends on `Show` typeclass;\r\n- `clone`, `cloneTo` methods are replaced in favour to new `copy` method;\r\n\r\nThis PR is little bit messy because this branch contains commit from #34 \r\nI'll add tests a bit later.\r\n\r\nI still have problems with implementations for following:\r\n- Methods “getAddr” and “setAddr” methods look exactly the same like “getLex” and “setLex”, except that given values are wrapped in “FIXNUM(ADDR_TO_PRE_FIXNUM(_))” and PRE_FIXNUM_TO_ADDR(FIXVAL(_))”. I’m not sure that this difference should be reflected in Scala implementation.\r\n- Not sure that I can provide a correct implementation for \"getField” and “setField” methods. Any help would be appreciated!","created_at":"2017-10-29T22:54:22Z","updated_at":"2017-10-31T14:30:17Z","closed_at":"2017-10-31T14:05:47Z","merged_at":null,"merge_commit_sha":"34c9f51683c9e0c4ffe19da5ddb361cc74ae353b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/rchain/rchain/pulls/35/commits","review_comments_url":"https://api.github.com/repos/rchain/rchain/pulls/35/comments","review_comment_url":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rchain/rchain/issues/35/comments","statuses_url":"https://api.github.com/repos/rchain/rchain/statuses/56e7574a4984a41364730397ea7bebe82260755c","head":{"label":"DoSOfRedRiver:dev-dosofredriver-ob-methods---generic-runtime-actions","ref":"dev-dosofredriver-ob-methods---generic-runtime-actions","sha":"56e7574a4984a41364730397ea7bebe82260755c","user":{"login":"DoSOfRedRiver","id":2995220,"avatar_url":"https://avatars1.githubusercontent.com/u/2995220?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSOfRedRiver","html_url":"https://github.com/DoSOfRedRiver","followers_url":"https://api.github.com/users/DoSOfRedRiver/followers","following_url":"https://api.github.com/users/DoSOfRedRiver/following{/other_user}","gists_url":"https://api.github.com/users/DoSOfRedRiver/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSOfRedRiver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSOfRedRiver/subscriptions","organizations_url":"https://api.github.com/users/DoSOfRedRiver/orgs","repos_url":"https://api.github.com/users/DoSOfRedRiver/repos","events_url":"https://api.github.com/users/DoSOfRedRiver/events{/privacy}","received_events_url":"https://api.github.com/users/DoSOfRedRiver/received_events","type":"User","site_admin":false},"repo":{"id":106763980,"name":"rchain","full_name":"DoSOfRedRiver/rchain","owner":{"login":"DoSOfRedRiver","id":2995220,"avatar_url":"https://avatars1.githubusercontent.com/u/2995220?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSOfRedRiver","html_url":"https://github.com/DoSOfRedRiver","followers_url":"https://api.github.com/users/DoSOfRedRiver/followers","following_url":"https://api.github.com/users/DoSOfRedRiver/following{/other_user}","gists_url":"https://api.github.com/users/DoSOfRedRiver/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSOfRedRiver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSOfRedRiver/subscriptions","organizations_url":"https://api.github.com/users/DoSOfRedRiver/orgs","repos_url":"https://api.github.com/users/DoSOfRedRiver/repos","events_url":"https://api.github.com/users/DoSOfRedRiver/events{/privacy}","received_events_url":"https://api.github.com/users/DoSOfRedRiver/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DoSOfRedRiver/rchain","description":null,"fork":true,"url":"https://api.github.com/repos/DoSOfRedRiver/rchain","forks_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/forks","keys_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/teams","hooks_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/hooks","issue_events_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/issues/events{/number}","events_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/events","assignees_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/assignees{/user}","branches_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/branches{/branch}","tags_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/tags","blobs_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/languages","stargazers_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/stargazers","contributors_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/contributors","subscribers_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/subscribers","subscription_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/subscription","commits_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/contents/{+path}","compare_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/merges","archive_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/downloads","issues_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/issues{/number}","pulls_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/labels{/name}","releases_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/releases{/id}","deployments_url":"https://api.github.com/repos/DoSOfRedRiver/rchain/deployments","created_at":"2017-10-13T01:39:25Z","updated_at":"2017-10-13T01:39:28Z","pushed_at":"2017-10-31T14:25:23Z","git_url":"git://github.com/DoSOfRedRiver/rchain.git","ssh_url":"git@github.com:DoSOfRedRiver/rchain.git","clone_url":"https://github.com/DoSOfRedRiver/rchain.git","svn_url":"https://github.com/DoSOfRedRiver/rchain","homepage":null,"size":1534,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rchain:dev","ref":"dev","sha":"15a0705a24449f76a185e10ee06f1eb6f0ccd43d","user":{"login":"rchain","id":20671765,"avatar_url":"https://avatars0.githubusercontent.com/u/20671765?v=4","gravatar_id":"","url":"https://api.github.com/users/rchain","html_url":"https://github.com/rchain","followers_url":"https://api.github.com/users/rchain/followers","following_url":"https://api.github.com/users/rchain/following{/other_user}","gists_url":"https://api.github.com/users/rchain/gists{/gist_id}","starred_url":"https://api.github.com/users/rchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchain/subscriptions","organizations_url":"https://api.github.com/users/rchain/orgs","repos_url":"https://api.github.com/users/rchain/repos","events_url":"https://api.github.com/users/rchain/events{/privacy}","received_events_url":"https://api.github.com/users/rchain/received_events","type":"Organization","site_admin":false},"repo":{"id":84493691,"name":"rchain","full_name":"rchain/rchain","owner":{"login":"rchain","id":20671765,"avatar_url":"https://avatars0.githubusercontent.com/u/20671765?v=4","gravatar_id":"","url":"https://api.github.com/users/rchain","html_url":"https://github.com/rchain","followers_url":"https://api.github.com/users/rchain/followers","following_url":"https://api.github.com/users/rchain/following{/other_user}","gists_url":"https://api.github.com/users/rchain/gists{/gist_id}","starred_url":"https://api.github.com/users/rchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchain/subscriptions","organizations_url":"https://api.github.com/users/rchain/orgs","repos_url":"https://api.github.com/users/rchain/repos","events_url":"https://api.github.com/users/rchain/events{/privacy}","received_events_url":"https://api.github.com/users/rchain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rchain/rchain","description":null,"fork":false,"url":"https://api.github.com/repos/rchain/rchain","forks_url":"https://api.github.com/repos/rchain/rchain/forks","keys_url":"https://api.github.com/repos/rchain/rchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rchain/rchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rchain/rchain/teams","hooks_url":"https://api.github.com/repos/rchain/rchain/hooks","issue_events_url":"https://api.github.com/repos/rchain/rchain/issues/events{/number}","events_url":"https://api.github.com/repos/rchain/rchain/events","assignees_url":"https://api.github.com/repos/rchain/rchain/assignees{/user}","branches_url":"https://api.github.com/repos/rchain/rchain/branches{/branch}","tags_url":"https://api.github.com/repos/rchain/rchain/tags","blobs_url":"https://api.github.com/repos/rchain/rchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rchain/rchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rchain/rchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/rchain/rchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rchain/rchain/statuses/{sha}","languages_url":"https://api.github.com/repos/rchain/rchain/languages","stargazers_url":"https://api.github.com/repos/rchain/rchain/stargazers","contributors_url":"https://api.github.com/repos/rchain/rchain/contributors","subscribers_url":"https://api.github.com/repos/rchain/rchain/subscribers","subscription_url":"https://api.github.com/repos/rchain/rchain/subscription","commits_url":"https://api.github.com/repos/rchain/rchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/rchain/rchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/rchain/rchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/rchain/rchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/rchain/rchain/contents/{+path}","compare_url":"https://api.github.com/repos/rchain/rchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rchain/rchain/merges","archive_url":"https://api.github.com/repos/rchain/rchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rchain/rchain/downloads","issues_url":"https://api.github.com/repos/rchain/rchain/issues{/number}","pulls_url":"https://api.github.com/repos/rchain/rchain/pulls{/number}","milestones_url":"https://api.github.com/repos/rchain/rchain/milestones{/number}","notifications_url":"https://api.github.com/repos/rchain/rchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rchain/rchain/labels{/name}","releases_url":"https://api.github.com/repos/rchain/rchain/releases{/id}","deployments_url":"https://api.github.com/repos/rchain/rchain/deployments","created_at":"2017-03-09T22:15:35Z","updated_at":"2017-10-23T20:54:40Z","pushed_at":"2017-10-31T14:05:48Z","git_url":"git://github.com/rchain/rchain.git","ssh_url":"git@github.com:rchain/rchain.git","clone_url":"https://github.com/rchain/rchain.git","svn_url":"https://github.com/rchain/rchain","homepage":null,"size":1532,"stargazers_count":16,"watchers_count":16,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":3,"forks":8,"open_issues":3,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/35"},"html":{"href":"https://github.com/rchain/rchain/pull/35"},"issue":{"href":"https://api.github.com/repos/rchain/rchain/issues/35"},"comments":{"href":"https://api.github.com/repos/rchain/rchain/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/rchain/rchain/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rchain/rchain/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/rchain/rchain/statuses/56e7574a4984a41364730397ea7bebe82260755c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"tymm"}}