GitHub PullRequestReviewCommentEvent at 2014-03-19 10:10:39
Repository: interpreter
Actor: xeno-by
Payload: {"comment":{"url":"https://api.github.com/repos/scalareflect/interpreter/pulls/comments/10743041","id":10743041,"diff_hunk":"@@ -159,6 +173,87 @@ abstract class Engine extends InterpreterRequires with Errors {\n     vcond.branch(eval(then1, env1), eval(else1, env1))\n   }\n \n+  def evalMatch(scrut: Tree, cases: List[CaseDef], env: Env): Result = {\n+    // TODO: semantics of evalPattern is just a sketch\n+    // it should be validated against the spec and the code that's emitted by the pattern matcher\n+    def succeed(resultEnv: Env) = eval(q\"true\", resultEnv)\n+    def fail(resultEnv: Env) = eval(q\"false\", resultEnv)\n+    def evalPattern(vscrut: Value, pat: Tree, matchEnv: Env, resultEnv: Env): Result = pat match {\n+      case Ident(termNames.WILDCARD) =>\n+        succeed(resultEnv)\n+      case Typed(_, tpt) =>\n+        val Result(result, matchEnv1) = eval(q\"$vscrut.${Any_isInstanceOf}[$tpt]()\", matchEnv)","path":"interpreter/src/main/scala/scala/reflect/interpreter/internal/Engine.scala","position":69,"original_position":69,"commit_id":"7c614f737b1f3ad33b96399e0efc0c95dd65bd3a","original_commit_id":"7c614f737b1f3ad33b96399e0efc0c95dd65bd3a","user":{"login":"xeno-by","id":609152,"avatar_url":"https://avatars.githubusercontent.com/u/609152?","gravatar_id":"69e339fd10a5ad804c45e22c819c67ad","url":"https://api.github.com/users/xeno-by","html_url":"https://github.com/xeno-by","followers_url":"https://api.github.com/users/xeno-by/followers","following_url":"https://api.github.com/users/xeno-by/following{/other_user}","gists_url":"https://api.github.com/users/xeno-by/gists{/gist_id}","starred_url":"https://api.github.com/users/xeno-by/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xeno-by/subscriptions","organizations_url":"https://api.github.com/users/xeno-by/orgs","repos_url":"https://api.github.com/users/xeno-by/repos","events_url":"https://api.github.com/users/xeno-by/events{/privacy}","received_events_url":"https://api.github.com/users/xeno-by/received_events","type":"User","site_admin":false},"body":"There's also `Object_isInstanceOf`.","created_at":"2014-03-19T10:10:39Z","updated_at":"2014-03-19T10:10:39Z","html_url":"https://github.com/scalareflect/interpreter/pull/8#discussion_r10743041","pull_request_url":"https://api.github.com/repos/scalareflect/interpreter/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/scalareflect/interpreter/pulls/comments/10743041"},"html":{"href":"https://github.com/scalareflect/interpreter/pull/8#discussion_r10743041"},"pull_request":{"href":"https://api.github.com/repos/scalareflect/interpreter/pulls/8"}}}}