{"action":"closed","issue":{"url":"https://api.github.com/repos/xxgreg/mustache/issues/4","labels_url":"https://api.github.com/repos/xxgreg/mustache/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/xxgreg/mustache/issues/4/comments","events_url":"https://api.github.com/repos/xxgreg/mustache/issues/4/events","html_url":"https://github.com/xxgreg/mustache/issues/4","id":15486783,"number":4,"title":"Support lambdas","user":{"login":"michaelhixson","id":297150,"avatar_url":"https://avatars.githubusercontent.com/u/297150?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelhixson","html_url":"https://github.com/michaelhixson","followers_url":"https://api.github.com/users/michaelhixson/followers","following_url":"https://api.github.com/users/michaelhixson/following{/other_user}","gists_url":"https://api.github.com/users/michaelhixson/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelhixson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelhixson/subscriptions","organizations_url":"https://api.github.com/users/michaelhixson/orgs","repos_url":"https://api.github.com/users/michaelhixson/repos","events_url":"https://api.github.com/users/michaelhixson/events{/privacy}","received_events_url":"https://api.github.com/users/michaelhixson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2013-06-13T03:21:59Z","updated_at":"2015-02-12T09:17:52Z","closed_at":"2015-02-12T09:17:52Z","body":"Hello.  It's me again. :)\r\n\r\nI have an implementation of lambdas locally.  Are you interested in adding lambda support to this library?\r\n\r\nIf so, how can they be properly tested in mustache_spec_test?  The ~lambdas.yml file seems to include code for various languages as strings, which I take to mean it implicitly relies on the existence of an \"eval\" function in the language.  AFAIK Dart doesn't have eval, so...\r\n\r\nAny advice on how to make the tests work?  My current thought is to:\r\n\r\n* Add 'dart' entries under each 'lambda' section in ~lambdas.yml.\r\n* In mustache_spec_test.dart, add something like this at the top of the runTest function:\r\n\r\n```\r\n// Special case: the lambda tests contain source code for various languages.\r\n// Extract out this code and run it in a new isolate.  Then, replace that\r\n// entry with a map with a function that talks to the isolate.\r\nif (data.containsKey('lambda') && data['lambda'].containsKey['dart']) {\r\n    String lambdaSource = data['lambda']['dart'];\r\n    String lambdaUri = 'tmp/lambda.dart';\r\n    File lambdaFile = new File('tmp/lambda.dart');\r\n    IOSink lambdaSink = lambdaFile.openWrite();\r\n    lambdaSink.add(lambdaSource.codeUnits);\r\n    isolate.SendPort port = isolate.spawnUri(lambdaUri);\r\n    data['lambda'] = ??? // I reached the limit of my Dart skills\r\n}\r\n```\r\n\r\n"}}