{"id":20660969,"url":"https://github.com/liatemplates/biwascheme","last_synced_at":"2026-05-20T16:41:01.377Z","repository":{"id":107256829,"uuid":"255331798","full_name":"LiaTemplates/BiwaScheme","owner":"LiaTemplates","description":"Template for integrating the BiwaScheme interpreter, which runs on JavaScript, into LiaScript courses.","archived":false,"fork":false,"pushed_at":"2023-10-23T11:40:08.000Z","size":85,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T12:16:29.604Z","etag":null,"topics":["liascript","liascript-template","markdown","oer","open-course","scheme"],"latest_commit_sha":null,"homepage":"https://liascript.github.io/course/?https://github.com/liaTemplates/BiwaScheme","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiaTemplates.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-13T13:15:20.000Z","updated_at":"2024-07-04T18:00:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"e981ed37-d00d-4bb6-b544-b9645e7a6145","html_url":"https://github.com/LiaTemplates/BiwaScheme","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiaTemplates%2FBiwaScheme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiaTemplates%2FBiwaScheme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiaTemplates%2FBiwaScheme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiaTemplates%2FBiwaScheme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiaTemplates","download_url":"https://codeload.github.com/LiaTemplates/BiwaScheme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242787903,"owners_count":20185189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["liascript","liascript-template","markdown","oer","open-course","scheme"],"created_at":"2024-11-16T19:06:39.610Z","updated_at":"2026-05-20T16:40:56.343Z","avatar_url":"https://github.com/LiaTemplates.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nauthor:   André Dietrich\nemail:    LiaScript@web.de\nversion:  0.0.5\nlanguage: en\nnarrator: UK English Male\nlogo:     https://raw.githubusercontent.com/biwascheme/biwascheme/master/website/images/biwascheme_logo.png\n\ncomment:  Template for integrating the\n  [BiwaScheme](https://www.biwascheme.org) interpreter, which runs on\n  JavaScript, into LiaScript courses.\n\nattribute: [BiwaScheme](https://github.com/biwascheme/biwascheme) is released by\n  Yutaka HARA (yhara) yutaka.hara.gmail.com http://twitter.com/yhara_en\n\n\nscript:   https://www.biwascheme.org/release/biwascheme-0.8.0-min.js\n\n@BiwaScheme.eval\n\u003cscript\u003e\n// window.console = console\n\nBiwaScheme.Console.puts = function(str, x){ console.stream(str + (x ? '\\n' : '')) }\n\nvar biwa = new BiwaScheme.Interpreter(console.error)\nbiwa.evaluate(`@input`, function(result) {\n  if (result \u0026\u0026 result != \"#\u003cundef\u003e\") {\n    console.debug(result)\n  }\n});\n\"LIA: stop\"\n\u003c/script\u003e\n@end\n\n\n@BiwaScheme.evalWithTerminal\n\u003cscript\u003e\n// window.console = console\n\nBiwaScheme.Console.puts = function(str, x){ console.stream(str + (x ? '\\n' : '')) }\n\nvar biwa = new BiwaScheme.Interpreter(console.error)\n\nsetTimeout(function() {\n  biwa.evaluate(`@input`, function(result) {\n    if (result \u0026\u0026 result != \"#\u003cundef\u003e\") {\n      console.debug(result)\n    }\n  });\n}, 100)\n\nsend.handle(\"input\", input =\u003e {\n  try{\n    biwa.evaluate(input, function(result) {\n      if (result \u0026\u0026 result != \"#\u003cundef\u003e\") {\n        console.debug(result)\n      }\n    })\n  } catch (e) {\n    console.error(e);\n  }\n})\n\nsend.handle(\"stop\", e =\u003e { console.log(\"execution stopped\") })\n\n\"LIA: terminal\"\n\u003c/script\u003e\n\n@end\n--\u003e\n\n# BiwaScheme - Template\n\n\n\n                         --{{0}}--\nThis document defines some basic macros for applying the JavaScript\n[BiwaScheme](https://www.biwascheme.org) interpreter in\n[LiaScript](https://LiaScript.github.io) to make Scheme code snippets in\nMarkdown executeable and editable.\n\n__Try it on LiaScript:__\n\nhttps://liascript.github.io/course/?https://github.com/liaTemplates/BiwaScheme\n\n__See the project on Github:__\n\nhttps://github.com/liaTemplates/BiwaScheme\n\n                         --{{1}}--\nThere are three ways to use this template. The easiest way is to use the\n`import` statement and the url of the raw text-file of the master branch or any\nother branch or version. But you can also copy the required functionionality\ndirectly into the header of your Markdown document, see therefor the\n[last slide](#Implementation). And of course, you could also clone this project\nand change it, as you wish.\n\n  {{1}}\n1. Load the macros via\n\n   `import: https://raw.githubusercontent.com/liaTemplates/BiwaScheme/master/README.md`\n\n2. Copy the definitions into your Project\n\n3. Clone this repository on GitHub\n\n\n## `@BiwaScheme.eval`\n\n                         --{{0}}--\nTo use the [BiwaScheme](https://www.biwascheme.org) interpreter, simply add the\nmacros `@BiwaScheme.eval` to the end of your scheme snippet.\n\n``` scheme\n(define (fizzbuzz x y)\n  (print\n    (cond (( = (mod x 15) 0 ) \"FizzBuzz\")\n          (( = (mod x 3) 0 ) \"Fizz\")\n          (( = (mod x 5) 0 ) \"Buzz\")\n          (else x)))\n\n    (if (\u003c x y) (fizzbuzz (+ x 1) y)))\n\n(fizzbuzz 1 10)\n```\n@BiwaScheme.eval\n\n                         --{{1}}--\nFor a complete overview on all available functions, see the BiwaScheme project\nwebsite:\n\n                           {{1}}\nhttps://www.biwascheme.org/doc/reference.html\n\n\n## `@BiwaScheme.evalWithTerminal`\n\n                         --{{0}}--\nUse the `@BiwaScheme.evalWithTerminal` macro, if you want to enable interactive\nprogramming. This opens a terminal after the programm execution that allows to\nexecute scheme code. Add for example your `fizzbuzz` command with different parameters.\n\n``` scheme\n(define (fizzbuzz x y)\n  (print\n    (cond (( = (mod x 15) 0 ) \"FizzBuzz\")\n          (( = (mod x 3) 0 ) \"Fizz\")\n          (( = (mod x 5) 0 ) \"Buzz\")\n          (else x)))\n\n    (if (\u003c x y) (fizzbuzz (+ x 1) y)))\n```\n@BiwaScheme.evalWithTerminal\n\n## Implementation\n\n                         --{{0}}--\nThe code shows how the macros were implemented by using a minified version of\nthe BiwaScheme JavaScript interpreter.\n\n``` html\nscript:   ./biwascheme-0.8.0-min.js\n\n@BiwaScheme.eval\n\u003cscript\u003e\nBiwaScheme.Console.puts = function(str, x){ console.stream(str + (x ? '\\n' : '')) }\n\nvar biwa = new BiwaScheme.Interpreter(console.error)\nbiwa.evaluate(`@input`, function(result) {\n  if (result \u0026\u0026 result != \"#\u003cundef\u003e\") {\n    console.debug(result)\n  }\n});\n\"LIA: stop\"\n\u003c/script\u003e\n@end\n\n\n@BiwaScheme.evalWithTerminal\n\u003cscript\u003e\nBiwaScheme.Console.puts = function(str, x){ console.stream(str + (x ? '\\n' : '')) }\n\nvar biwa = new BiwaScheme.Interpreter(console.error)\n\nsetTimeout(function() {\n  biwa.evaluate(`@input`, function(result) {\n    if (result \u0026\u0026 result != \"#\u003cundef\u003e\") {\n      console.debug(result)\n    }\n  });\n}, 100)\n\nsend.handle(\"input\", input =\u003e {\n  try{\n    biwa.evaluate(input, function(result) {\n      if (result \u0026\u0026 result != \"#\u003cundef\u003e\") {\n        console.debug(result)\n      }\n    })\n  } catch (e) {\n    console.error(e);\n  }\n})\n\nsend.handle(\"stop\", e =\u003e { console.log(\"execution stopped\") })\n\n\"LIA: terminal\"\n\u003c/script\u003e\n\n@end\n\n```\n\n\n                         --{{1}}--\nIf you want to minimize loading effort in your LiaScript project, you can also\ncopy this code and paste it into your main comment header, see the code in the\nraw file of this document.\n\n{{1}} https://raw.githubusercontent.com/liaTemplates/BiwaScheme/master/README.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliatemplates%2Fbiwascheme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliatemplates%2Fbiwascheme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliatemplates%2Fbiwascheme/lists"}