-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.iron.js
1 lines (1 loc) · 35.6 KB
/
app.iron.js
1
ironscript.runPackage("{\"config\":{\"main\":\"./app.is\",\"dest\":\"./app.iron.js\",\"imports\":[{\"name\":\"http\",\"url\":\"./js/http.js\"}]},\"rootfs\":\"{\\\"type\\\":\\\"directory\\\",\\\"name\\\":\\\"root\\\",\\\"content\\\":[{\\\"type\\\":\\\"directory\\\",\\\"name\\\":\\\"include\\\",\\\"content\\\":[{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"stdlib\\\",\\\"content\\\":\\\"_sync\\\\n (_import \\\\\\\"_stdlib/operators\\\\\\\" _all)\\\\n (_import \\\\\\\"_stdlib/streams\\\\\\\" _all)\\\\n (_import \\\\\\\"_stdlib/constructs\\\\\\\" _all)\\\\n\\\\t(_include \\\\\\\"_stdlib/easy-syntax\\\\\\\")\\\\n\\\"},{\\\"type\\\":\\\"directory\\\",\\\"name\\\":\\\"_stdlib\\\",\\\"content\\\":[{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"operators\\\",\\\"content\\\":\\\"; Copyright (c) 2016, Ganesh Prasad Sahoo <[email protected]>\\\\n \\\\n; IRONSCRIPT Standard Library (Operators.is)\\\\n; Implements the most used javascript operators for use in ironscript.\\\\n; Prefer _include at global-scope over _import in case of stdlib files.\\\\n\\\\n_sync\\\\n \\\\n (_def + @{ \\\\n\\\\t\\\\ttry { $return (args[0]+args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def - @{ \\\\n\\\\t\\\\ttry { $return (args[0]-args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def * @{ \\\\n\\\\t\\\\ttry { $return (args[0]*args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def / @{ \\\\n\\\\t\\\\ttry { $return (args[0]/args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def % @{ \\\\n\\\\t\\\\ttry { $return (args[0]%args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n\\\\n\\\\n (_def == @{ \\\\n\\\\t\\\\ttry { $return (args[0]==args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def != @{ \\\\n\\\\t\\\\ttry { $return (args[0]!=args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def === @{ \\\\n\\\\t\\\\ttry { $return (args[0]===args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def !== @{ \\\\n\\\\t\\\\ttry { $return (args[0]!==args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n\\\\n\\\\n (_def > @{ \\\\n\\\\t\\\\ttry { $return (args[0]>args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def < @{ \\\\n\\\\t\\\\ttry { $return (args[0]<args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def >= @{ \\\\n\\\\t\\\\ttry { $return (args[0]>=args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def <= @{ \\\\n\\\\t\\\\ttry { $return (args[0]<=args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def && @{ \\\\n\\\\t\\\\ttry { $return (args[0]&&args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n (_def || @{ \\\\n\\\\t\\\\ttry { $return (args[0]||args[1]); }\\\\n\\\\t\\\\tcatch (e) { $throw (e); }\\\\n\\\\t}@ )\\\\n\\\\n (_def concat @{ \\\\n let s = '';\\\\n for (let arg of args) s += arg;\\\\n $return (s);\\\\n }@ )\\\\n\\\\t\\\\n\\\\t(_def not @{ $return (! args[0]); }@ )\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"streams\\\",\\\"content\\\":\\\"; Copyright (c) 2016, Ganesh Prasad Sahoo <[email protected]>\\\\n \\\\n; IRONSCRIPT Standard Library (Streams.is)\\\\n; Implements some common stream modifiers and utility streams.\\\\n\\\\n_sync\\\\n (_import \\\\\\\"_stdlib/operators\\\\\\\" _all)\\\\n\\\\n (_def log-stream (_fn (stream stream-name) (_stream concat stream-name \\\\\\\" :: \\\\\\\" (stream) ) ) )\\\\n (_def echo-stream (_fn (stream) (_stream _echo (stream) ) ) )\\\\n\\\\n (_def count-stream (_fn (stream)\\\\n (_stream\\\\n \\\\n (_begin\\\\n (_def counter (_fn () \\\\n (_begin\\\\n (_def c 0)\\\\n (_fn (x) \\\\n (_if x \\\\n (_assign! c (+ c 1) ) \\\\n () \\\\n ) \\\\n )\\\\n ) \\\\n ) )\\\\n (counter)\\\\n )\\\\n\\\\n (stream)\\\\n )\\\\n ) )\\\\n\\\\n (_def max-stream (_fn (stream)\\\\n (_stream\\\\n \\\\n (_begin\\\\n (_def maxer (_fn () \\\\n (_begin\\\\n (_def m 0)\\\\n (_fn (x) \\\\n (_if (> x m) \\\\n (_assign! m x ) \\\\n m \\\\n ) \\\\n )\\\\n ) \\\\n ) )\\\\n (maxer)\\\\n )\\\\n\\\\n (stream)\\\\n )\\\\n ) )\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"constructs\\\",\\\"content\\\":\\\"_sync\\\\n\\\\n\\\\t; cond macro\\\\n\\\\n\\\\t(_let cond (_fr (exp : exps) \\\\n\\\\t\\\\t(_if (_ (_car exp)) \\\\n\\\\t\\\\t\\\\t(_ (_car (_cdr exp) ) )\\\\n\\\\t\\\\t\\\\t(_ (cond :exps) ) \\\\n\\\\t\\\\t)\\\\n\\\\t) )\\\\n\\\\n\\\\t(_def typeof @{ $return (typeof args[0]); }@ )\\\\n\\\\n\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"easy-syntax\\\",\\\"content\\\":\\\"; easy-syntax rewriting\\\\n_sync\\\\n\\\\t\\\\n\\\\t; easy maths\\\\n\\\\n (_rho (@a + @b) (+ @a @b))\\\\n (_rho (@a - @b) (- @a @b))\\\\n (_rho (@a * @b) (* @a @b))\\\\n (_rho (@a / @b) (/ @a @b))\\\\n (_rho (@a % @b) (% @a @b))\\\\n\\\\n (_rho (@a == @b) (== @a @b))\\\\n (_rho (@a != @b) (!= @a @b))\\\\n (_rho (@a === @b) (=== @a @b))\\\\n (_rho (@a !== @b) (!== @a @b))\\\\n \\\\n (_rho (@a > @b) (> @a @b))\\\\n (_rho (@a < @b) (< @a @b))\\\\n (_rho (@a >= @b) (>= @a @b))\\\\n (_rho (@a <= @b) (<= @a @b))\\\\n \\\\n (_rho (@a && @b) (&& @a @b))\\\\n (_rho (@a || @b) (|| @a @b))\\\\n\\\\n\\\\t\\\\n\\\\t; easy constructs\\\\n\\\\n\\\\t(_rho (@a = @b) (_let @a @b))\\\\n\\\\t(_rho (@a <-- @b) (_set! @a @b))\\\\n\\\\t(_rho (if @a then @b else @c) (_if @a @b @c))\\\\n\\\\t(_rho (if @a @b) (_if @a @b NIL))\\\\n\\\\t(_rho (unless @a @b) (_if @a NIL @b))\\\\n\\\\n\\\\t(_rho (defun @name @params @body) [@name = (_fn @params @body) ] )\\\\n\\\\t(_rho (defmacro @name @params @body) [@name = (_fr @params @body) ] )\\\\n\\\\n\\\\t(_rho (import @names from @file) (_import @file @names))\\\\n\\\\n\\\"}]}]},{\\\"type\\\":\\\"directory\\\",\\\"name\\\":\\\"bundle\\\",\\\"content\\\":[{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"app.is\\\",\\\"content\\\":\\\"_module \\\\\\\"Main\\\\\\\"\\\\n (_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t(_use \\\\\\\"./src/virtualdom.is\\\\\\\")\\\\n\\\\n\\\\t(_import \\\\\\\"./src/http.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./src/actions.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./src/data-streams.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./src/flask.is\\\\\\\" _all)\\\\n\\\\n\\\\t(_import \\\\\\\"./src/header.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./src/hero.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./src/homepage.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./src/tryonline.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./src/footer.is\\\\\\\" _all)\\\\n\\\\n\\\\t\\\\n\\\\t[defun COMPONENTS.app (props)\\\\n\\\\t\\\\t[T \\\\\\\"body\\\\\\\"\\\\n\\\\t\\\\t\\\\t[T \\\\\\\"Header\\\\\\\"]\\\\n\\\\t\\\\t\\\\t[T \\\\\\\"Hero\\\\\\\"]\\\\n\\\\t\\\\t\\\\t[T \\\\\\\"HomepageMain\\\\\\\"]\\\\n\\\\t\\\\t\\\\t[T \\\\\\\"TryOnline\\\\\\\"]\\\\n\\\\t\\\\t\\\\t[T \\\\\\\"Footer\\\\\\\"]\\\\n\\\\t\\\\t]\\\\n\\\\t] \\\\n\\\\n\\\\t(update \\\\\\\"app-root\\\\\\\" [T \\\\\\\"app\\\\\\\"])\\\\n\\\\t( @{\\\\n\\\\t\\\\tdocument.getElementById(\\\\\\\"app-body\\\\\\\").className += \\\\\\\" hide\\\\\\\";\\\\n\\\\t}@ NIL)\\\\n\\\\n\\\\t(update \\\\\\\"show-website-src\\\\\\\" [T \\\\\\\"code\\\\\\\" (ajax-get-file \\\\\\\"/samples/quine.is\\\\\\\") ] )\\\\n\\\\t\\\\n\\\\t[flask = (FLASK.init \\\\\\\"#editor\\\\\\\")]\\\\n\\\\t[DATA-STREAMS.source-code-stream = (_stream FLASK.magic flask)]\\\\n\\\\n\\\\t(_do (_on DATA-STREAMS.sample-program-stream (_begin\\\\n\\\\t\\\\t(FLASK.update flask (_pull DATA-STREAMS.sample-program-stream) ) \\\\n\\\\t\\\\t(_push DATA-STREAMS.source-code-stream (_pull DATA-STREAMS.sample-program-stream) )\\\\n\\\\t) ) )\\\\n\\\"},{\\\"type\\\":\\\"directory\\\",\\\"name\\\":\\\"src\\\",\\\"content\\\":[{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"virtualdom.is\\\",\\\"content\\\":\\\"_module \\\\\\\"VirtualDOM\\\\\\\"\\\\n\\\\t\\\\n\\\\t(_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t(_import \\\\\\\"./vdom.is\\\\\\\" _all)\\\\n\\\\t\\\\n\\\\t[_rho (H @tag) (h @tag {}) ]\\\\n\\\\t[_rho (H @tag @props) (h @tag @props) ]\\\\n\\\\t[_rho (H @tag @props :@children) (h @tag @props :@children) ]\\\\n\\\\t[_rho (T @tag :@children) (h @tag {} :@children) ]\\\\n\\\\t[_rho (T @tag) (h @tag {}) ]\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"vdom.is\\\",\\\"content\\\":\\\"_module \\\\\\\"VDOM : The Virtual DOM implementation in Ironscript\\\\\\\"\\\\n (_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\n [defun h (type props :children) (_begin\\\\n\\\\t\\\\t[res = {}]\\\\n\\\\t\\\\t[res.props = props]\\\\n \\\\n\\\\t\\\\t;(DEBUG res.props)\\\\n\\\\t\\\\t[parse-type-string = @{\\\\n\\\\t\\\\t\\\\tvar type = args[0];\\\\n\\\\t\\\\t\\\\tvar idDelim = args[1];\\\\n\\\\t\\\\t\\\\tvar classDelim = args[2];\\\\n\\\\t\\\\t\\\\tif (!idDelim) idDelim = '#';\\\\n\\\\t\\\\t\\\\tif (!classDelim) classDelim = '.';\\\\n\\\\n\\\\t\\\\t\\\\tfunction parseClass (str) {\\\\n\\\\t\\\\t\\\\t\\\\tvar tarr = str.split(classDelim);\\\\n\\\\t\\\\t\\\\t\\\\tvar type = \\\\\\\"div\\\\\\\";\\\\n\\\\t\\\\t\\\\t\\\\tif (classDelim !== str[0]) type = tarr[0];\\\\n\\\\t\\\\t\\\\t\\\\treturn [type, tarr.slice(1).join(' ')];\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction parseId (str) {\\\\n\\\\t\\\\t\\\\t\\\\tvar tarr = str.split(idDelim);\\\\n\\\\t\\\\t\\\\t\\\\tif (idDelim === str[0]) return [\\\\\\\"div\\\\\\\", \\\\\\\"\\\\\\\", tarr[1]];\\\\n\\\\t\\\\t\\\\t\\\\telse if (tarr.length > 1) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tlet ret = parseClass(tarr[0]);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tret.push(tarr[1]);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\treturn ret;\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\telse return parseClass(tarr[0]);\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t$return (parseId(type));\\\\n\\\\t\\\\t}@ ]\\\\n\\\\t\\\\t\\\\n [t = (parse-type-string type) ]\\\\n [if [\\\\\\\"object\\\\\\\" == (typeof t)]\\\\n then (_begin\\\\n [res.type = t.0]\\\\n [res.props.class = t.1]\\\\n\\\\t\\\\t\\\\t\\\\t;(DEBUG t.0)\\\\n\\\\t\\\\t\\\\t\\\\t;(DEBUG t.1)\\\\n\\\\t\\\\t\\\\t\\\\t;(DEBUG res.type)\\\\n\\\\t\\\\t\\\\t\\\\t;(DEBUG res.props)\\\\n\\\\t\\\\t\\\\t\\\\t;(DEBUG \\\\\\\"-------------------\\\\\\\")\\\\n\\\\t\\\\t\\\\t\\\\t[res.props.id = t.2]\\\\n )\\\\n\\\\t\\\\t\\\\telse [res.type = t]\\\\n ]\\\\n [if children [res.children = (_seq :children)] ]\\\\n\\\\t\\\\tres\\\\n ) ]\\\\n\\\\n\\\\n [COMPONENTS = {}]\\\\n\\\\t[NOOP = (_fn () NIL) ]\\\\n\\\\t[PORT = (_fn () (_stream NOOP NIL) ) ]\\\\n\\\\n\\\\t[node-counter = 0]\\\\n\\\\t[defun get-node-name (prefix) (_begin\\\\n\\\\t\\\\t(_set! node-counter [node-counter + 1])\\\\n\\\\t\\\\t[ [prefix + node-counter] + (random-string 8) ]\\\\n\\\\t) ]\\\\n\\\\n\\\\t[random-string = @{\\\\n\\\\t\\\\tfunction pow (base, exp) {\\\\n\\\\t\\\\t\\\\tvar res = 1;\\\\n\\\\t\\\\t\\\\tfor (var i = 0; i<exp; i++) res *= base;\\\\n\\\\t\\\\t\\\\treturn res;\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tvar len = args[0];\\\\n\\\\t\\\\t$return (Math.floor((Math.random()*pow(10,len)) + 1) );\\\\n\\\\t}@ ]\\\\n\\\\n\\\\n\\\\t[defun vnode (node id) (_begin\\\\n [type = node.type]\\\\n [if type\\\\n then (_begin\\\\n [componentfn = (_dot COMPONENTS type)]\\\\n [if componentfn\\\\n then (_begin\\\\n [nd = (componentfn node.props)]\\\\n [if node.props.id then (vnode nd node.props.id) else (vnode nd (get-node-name \\\\\\\"component-id-\\\\\\\") )]\\\\n )\\\\n\\\\t\\\\t\\\\t\\\\t\\\\telse {\\\\n [.type = type]\\\\n [.props = node.props]\\\\n [if node.props.id then [.id = node.props.id] else [.id = (get-node-name \\\\\\\"element-id-\\\\\\\") ] ]\\\\n [if node.children\\\\n [.children = (_map node.children (_fn (child index) \\\\n (vnode child (concat .id \\\\\\\".\\\\\\\" index) )\\\\n ) ) ]\\\\n ] \\\\n }\\\\n ]\\\\n )\\\\n\\\\t\\\\t\\\\telse node\\\\n ]\\\\n )]\\\\n\\\\n\\\\t[DEBUG = @{ console.log(args[0]); }@]\\\\n \\\\n\\\\t[EVENTS = {}]\\\\n\\\\t[listeners = {}]\\\\n (_let ignore (_begin\\\\n [init = (_volatile @{\\\\n var capt = true;\\\\n if (args[0] === \\\\\\\"false\\\\\\\") capt = false;\\\\n (\\\\\\\"keypress keydown keyup click dbclick scroll focus blur change search select submit input invalid\\\\\\\".split(\\\\\\\" \\\\\\\"))\\\\n\\\\t\\\\t\\\\t.forEach (function (e) {\\\\n\\\\t\\\\t\\\\t\\\\tdocument.getElementById(\\\\\\\"app-root\\\\\\\").addEventListener(e, function (ev) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t$yield(ev);\\\\n\\\\t\\\\t\\\\t\\\\t}, capt) ;\\\\n\\\\t\\\\t\\\\t});\\\\n }@ ) ]\\\\n\\\\t\\\\t\\\\n (_def EVENTS.event-stream (_stream init \\\\\\\"true\\\\\\\"))\\\\n \\\\n [defun EVENTS.listen (id event port) (_begin\\\\n\\\\t\\\\t\\\\t(_let key (+ id event))\\\\n (_let (_dot listeners key ) port)\\\\n\\\\t\\\\t) ]\\\\n [defun EVENTS.mute (id event) (_begin \\\\n\\\\t\\\\t\\\\t[key = [id + event]]\\\\n\\\\t\\\\t\\\\t[listeners.key = NIL]\\\\n\\\\t\\\\t) ]\\\\n [defun EVENTS.remove (id) ( (_volatile @{\\\\n var obj = args[0];\\\\n var id = args[1];\\\\n Object.keys(obj).forEach(function (name) {\\\\n if (name.startsWith(id) || name.startsWith(id+':')) obj[name] = undefined;\\\\n });\\\\n }@ ) listeners id ) ]\\\\n\\\\n (_do (_on EVENTS.event-stream \\\\n (_begin\\\\n [e = (_pull EVENTS.event-stream)]\\\\n\\\\t\\\\t\\\\t\\\\t(_let key [e.target.id + e.type])\\\\n (_let port (_dot listeners key) )\\\\n [if port (_push port e)]\\\\n )\\\\n ) )\\\\n ) )\\\\n\\\\n\\\\n [update-fn-internal = (_fx ( \\\\n\\\\t\\\\t(_volatile @{\\\\n \\\\n\\\\t\\\\t\\\\tfunction isEventProp (name) { return /^on/.test(name); }\\\\n\\\\t\\\\t\\\\tfunction extractEventName (name) { return name.slice(2).toLowerCase(); }\\\\n\\\\n\\\\t\\\\t\\\\tfunction isCustomProp (name) {\\\\n\\\\t\\\\t\\\\t\\\\tif (name === \\\\\\\"id\\\\\\\") return true;\\\\n\\\\t\\\\t\\\\t\\\\tif (name === \\\\\\\"injectContent\\\\\\\") return true;\\\\n\\\\t\\\\t\\\\t\\\\tif (isEventProp(name)) return true;\\\\n\\\\t\\\\t\\\\t\\\\treturn false;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\n\\\\t\\\\t\\\\t\\\\n\\\\t\\\\t\\\\t\\\\n\\\\t\\\\t\\\\tfunction setBooleanProp ($target, name, value) {\\\\n\\\\t\\\\t\\\\t\\\\tif (value) $target.setAttribute(name, value);\\\\n\\\\t\\\\t\\\\t\\\\t$target[name] = value;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction setProp ($target, name, value) {\\\\n\\\\t\\\\t\\\\t\\\\tif (isCustomProp(name)) return;\\\\n\\\\t\\\\t\\\\t\\\\telse if (typeof value === 'boolean') setBooleanProp ($target, name, value);\\\\n\\\\t\\\\t\\\\t\\\\telse $target.setAttribute (name, value);\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction setProps ($target, props) {\\\\n\\\\t\\\\t\\\\t\\\\tif (typeof props === 'object') Object.keys(props).forEach(function (name) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tsetProp($target, name, props[name]);\\\\n\\\\t\\\\t\\\\t\\\\t});\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction removeBooleanProp ($target, name) {\\\\n\\\\t\\\\t\\\\t\\\\t$target.removeAttribute (name);\\\\n\\\\t\\\\t\\\\t\\\\t$target[name] = false;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction removeProp ($target, name, value) {\\\\n\\\\t\\\\t\\\\t\\\\tif (isCustomProp(name)) return;\\\\n\\\\t\\\\t\\\\t\\\\telse if (typeof value === 'boolean') removeBooleanProp ($target, name);\\\\n\\\\t\\\\t\\\\t\\\\telse $target.removeAttribute (name);\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction updateProp ($target, name, newVal, oldVal) {\\\\n\\\\t\\\\t\\\\t\\\\tif (!newVal) removeProp ($target, name, oldVal);\\\\n\\\\t\\\\t\\\\t\\\\telse if (!oldval || newVal !== oldVal) setProp ($target, name, newVal);\\\\n\\\\t\\\\t\\\\t\\\\telse return;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction updateProps ($target, newProps, oldProps) {\\\\n\\\\t\\\\t\\\\t\\\\tif (!oldProps) oldProps = {};\\\\n\\\\t\\\\t\\\\t\\\\tvar props = Object.assign ({}, newProps, oldProps);\\\\n\\\\t\\\\t\\\\t\\\\tObject.keys(props).forEach (function (name) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tupdateProp ($target, name, newProps[name], oldProps[name]); \\\\n\\\\t\\\\t\\\\t\\\\t});\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\n\\\\t\\\\t\\\\tfunction addEventListeners (id, props) {\\\\n\\\\t\\\\t\\\\t\\\\tif (typeof props === 'object') Object.keys(props).forEach(function (name) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tif (isEventProp(name)) addPatch.push({id: id, type: extractEventName(name), port: props[name]});\\\\n\\\\t\\\\t\\\\t\\\\t});\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction injectContent ($el, props) {\\\\n\\\\t\\\\t\\\\t\\\\tif (typeof props === 'object' && props.injectContent) $el.innerHTML = props.injectContent;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\n\\\\t\\\\t\\\\tfunction createElement (node) {\\\\n\\\\t\\\\t\\\\t\\\\tif (typeof node === 'string') return document.createTextNode(node);\\\\n\\\\t\\\\t\\\\t\\\\tvar $el = document.createElement (node.type);\\\\n\\\\t\\\\t\\\\t\\\\t//console.log(\\\\\\\"Debug >>> \\\\\\\", node.type, $el);\\\\n\\\\t\\\\t\\\\t\\\\t$el.setAttribute(\\\\\\\"id\\\\\\\", node.id);\\\\n\\\\t\\\\t\\\\t\\\\tsetProps ($el, node.props);\\\\n\\\\n\\\\t\\\\t\\\\t\\\\taddEventListeners(node.id, node.props);\\\\n\\\\t\\\\t\\\\t\\\\tinjectContent ($el, node.props);\\\\n\\\\t\\\\t\\\\t\\\\tif (node.children) node.children.arr.map(createElement).forEach($el.appendChild.bind($el));\\\\n\\\\t\\\\t\\\\t\\\\treturn $el;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\n\\\\t\\\\t\\\\tfunction changed (node1, node2) {\\\\n\\\\t\\\\t\\\\t\\\\treturn typeof node1 !== typeof node2 \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t|| typeof node1 === 'string' && node1 !== node2 \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t|| node1.type !== node2.type \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t|| node1.id !== node2.id;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction Patch () {\\\\n\\\\t\\\\t\\\\t\\\\tthis.arr = [];\\\\n\\\\t\\\\t\\\\t\\\\tthis.push = function (x) {this.arr.push(x); }.bind(this);\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tvar addPatch = [];\\\\n\\\\t\\\\t\\\\tvar removePatch = [];\\\\n\\\\n\\\\t\\\\t\\\\tfunction updateElement ($par, newNode, oldNode, index=0) {\\\\n\\\\n\\\\t\\\\t\\\\t\\\\tif (! (oldNode||newNode) ) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tif ($par.childNodes.length) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tremovePatch.push($par.childNodes[index].id);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t$par.removeChild($par.childNodes[index]);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\telse if (!oldNode) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t$par.appendChild (createElement (newNode));\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\telse if (!newNode) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tremovePatch.push(oldNode.id);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t$par.removeChild($par.childNodes[index]);\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\telse if (changed(newNode, oldNode)) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tremovePatch.push(oldNode.id);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t$par.replaceChild(createElement(newNode), $par.childNodes[index]);\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\telse if (newNode.type) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tupdateProps($par.childNodes[index], newNode.props, oldNode.props);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar newLen = newNode.children.arr.length;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar oldLen = oldNode.children.arr.length;\\\\n\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tfor (var i=0; i<newLen || i<oldLen; i++) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tupdateElement ($par.childNodes[index], newNode.children.arr[i], oldNode.children.arr[i], i);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\tfunction update (id, newNode, oldNode) {\\\\n\\\\t\\\\t\\\\t\\\\tvar $par = document.getElementById (id);\\\\n\\\\t\\\\t\\\\t\\\\taddPatch = [];\\\\n\\\\t\\\\t\\\\t\\\\tremovePatch = [];\\\\n\\\\t\\\\t\\\\t\\\\tupdateElement ($par, newNode, oldNode);\\\\n\\\\t\\\\t\\\\t\\\\t//console.log(\\\\\\\"Phase-2\\\\\\\\n\\\\\\\\n\\\\\\\", newNode);\\\\n\\\\t\\\\t\\\\t\\\\treturn {add:addPatch, remove:removePatch};\\\\n\\\\t\\\\t\\\\t} \\\\n\\\\t\\\\t\\\\t$return (update);\\\\n\\\\t\\\\t}@ ) ) ) ]\\\\n\\\\n \\\\n\\\\t[defun update (id newNode oldNode) \\\\n\\\\t\\\\t(_begin\\\\n\\\\t\\\\t\\\\t[vOldNode = [if oldNode then (vnode oldNode) else NIL]]\\\\n\\\\t\\\\t\\\\t[vNewNode = [if newNode then (vnode newNode) else NIL]]\\\\n\\\\t\\\\t\\\\t;(_echo \\\\\\\"Phase-1\\\\\\\")\\\\n\\\\t\\\\t\\\\t;(DEBUG vNewNode);\\\\n\\\\t\\\\t\\\\t[patches = (update-fn-internal id vNewNode vOldNode ) ]\\\\n\\\\t\\\\t\\\\t(_map patches.remove (_fn (item) (EVENTS.remove item) ) )\\\\n\\\\t\\\\t\\\\t(_map patches.add (_fn (item) (EVENTS.listen item.id item.type item.port) ) )\\\\n\\\\t\\\\t)\\\\n\\\\t]\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"http.is\\\",\\\"content\\\":\\\"_sync\\\\n\\\\n\\\\t(_echo\\\\t\\\\\\\"\\\\\\\\n\\\\\\\\n **Warning**\\\\\\\\n\\\\\\\\n\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\" I am using a wrapper over http.js to do AJAX calls\\\\\\\\n\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\" in Ironscript (http.is it is called). The Javascript\\\\\\\\n\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\" implementation throws an error on success saying \\\\\\\\n\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\" 'can not read property fail'\\\\\\\\n\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\" I have not yet figured out why this happens.\\\\\\\\n\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\" So, expect these errors on console everytime you request\\\\\\\\n\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\" a resource. But We GOT caching, so you request things once\\\\\\\\n\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\" and happily reuse them ever after.\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\"\\\\n\\\\t)\\\\n\\\\t(_let ajax-get-file @{\\\\n\\\\t\\\\tvar req = new Http.Get (args[0], true);\\\\n\\\\t\\\\tvar promise = req.start().then( function (res) {\\\\n\\\\t\\\\t\\\\t$return (res);\\\\n\\\\t\\\\t});\\\\n\\\\t\\\\tpromise.fail ( function (err, errcode) {\\\\n\\\\t\\\\t\\\\t$throw (errcode);\\\\n\\\\t\\\\t});\\\\n\\\\t}@ )\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"actions.is\\\",\\\"content\\\":\\\"_module \\\\\\\"Actions\\\\\\\"\\\\n\\\\t\\\\n\\\\t(_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t(_import \\\\\\\"./vdom.is\\\\\\\" (PORT))\\\\n\\\\n\\\\t[ACTIONS = {}]\\\\n\\\\t[ACTIONS.open-online-editor = (PORT)]\\\\n\\\\t[ACTIONS.quit-online-editor = (PORT)]\\\\n\\\\t[ACTIONS.run-code = (PORT)]\\\\n\\\\t[ACTIONS.clear-output = (PORT)]\\\\n\\\\t[ACTIONS.select-sample-program = (PORT)]\\\\n\\\\t\\\\n\\\\t[ACTIONS.after-update = (PORT)]\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"data-streams.is\\\",\\\"content\\\":\\\"_module \\\\\\\"Data Streams\\\\\\\"\\\\n\\\\t\\\\n\\\\t(_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t(_import \\\\\\\"./vdom.is\\\\\\\" (PORT))\\\\n\\\\t\\\\n\\\\t[DATA-STREAMS = {}]\\\\n\\\\t[DATA-STREAMS.source-code-stream = (PORT)]\\\\n\\\\t[DATA-STREAMS.sample-program-stream = (PORT)]\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"flask.is\\\",\\\"content\\\":\\\"_module \\\\\\\"Flask (Wrapper on codeflask.js)\\\\\\\"\\\\n\\\\t(_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t\\\\n\\\\t[FLASK = {}]\\\\n\\\\t[FLASK.init = @{\\\\n\\\\t\\\\tvar flask = new CodeFlask;\\\\n\\\\t\\\\tflask.run(args[0], {language:'scheme'});\\\\n\\\\t\\\\t$return (flask);\\\\n\\\\t}@]\\\\n\\\\n\\\\t[FLASK.magic = @{\\\\n\\\\t\\\\targs[0].onUpdate(function(code) {$yield(code);});\\\\n\\\\t}@ ]\\\\n\\\\n\\\\t[FLASK.update = @{\\\\n\\\\t\\\\targs[0].update(args[1]);\\\\n\\\\t}@ ]\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"header.is\\\",\\\"content\\\":\\\"_module \\\\\\\"Header\\\\\\\"\\\\n\\\\n\\\\t(_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t(_use \\\\\\\"./virtualdom.is\\\\\\\")\\\\n\\\\t\\\\n\\\\t[defun COMPONENTS.Header (props)\\\\n\\\\t\\\\t(_begin\\\\n\\\\t\\\\t\\\\t[render = \\\\n\\\\t\\\\t\\\\n\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"nav.nav.is-dark.has-shadow#navbar\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".container\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".nav-left\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"a.nav-item\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"img\\\\\\\" { \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[.src = \\\\\\\"./assets/logo.png\\\\\\\"] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[.alt = \\\\\\\"Ironscript\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"span.nav-toggle\\\\\\\" \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"span\\\\\\\"] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"span\\\\\\\"] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"span\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".nav-right.nav-menu\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"a.nav-item.is-tab\\\\\\\" {[.href = \\\\\\\"#get-started\\\\\\\"]} \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"span.icon.margin-10\\\\\\\" [T \\\\\\\"i.fa.fa-rocket\\\\\\\"]] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\"Get Started\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"a.nav-item.is-tab\\\\\\\" {[.href = \\\\\\\"https://github.com/ironscript/ironscript/blob/master/README.md\\\\\\\"]}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"span.icon.margin-10\\\\\\\" [T \\\\\\\"i.fa.fa-hashtag\\\\\\\"]] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\"Documentation\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"a.nav-item.is-tab\\\\\\\" {[.href = \\\\\\\"https://github.com/ironscript/ironscript/wiki/Examples\\\\\\\"]}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"span.icon.margin-10\\\\\\\" [T \\\\\\\"i.fa.fa-heart\\\\\\\"]] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\"Examples\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"a.nav-item.is-tab\\\\\\\" {[.href = \\\\\\\"https://github.com/ironscript\\\\\\\"]}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"span.icon.margin-10\\\\\\\" [T \\\\\\\"i.fa.fa-github\\\\\\\"]] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\"Github\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\trender\\\\n\\\\t\\\\t)\\\\n\\\\t]\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"hero.is\\\",\\\"content\\\":\\\"_module \\\\\\\"Hero\\\\\\\"\\\\n\\\\t\\\\n\\\\t(_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t(_use \\\\\\\"./virtualdom.is\\\\\\\")\\\\n\\\\t(_import \\\\\\\"./actions.is\\\\\\\" _all)\\\\n\\\\n\\\\t[defun COMPONENTS.Hero (props)\\\\n\\\\t\\\\t[T \\\\\\\"section.hero.is-warning.is-bold.is-medium\\\\\\\" [T \\\\\\\".hero-body\\\\\\\" [T \\\\\\\".container\\\\\\\"\\\\n\\\\t\\\\t\\\\t[T \\\\\\\"h1.title.is-2.is-spaced\\\\\\\" \\\\\\\"Ironscript 1.2\\\\\\\" [T \\\\\\\"sup\\\\\\\" \\\\\\\"Beta\\\\\\\"]]\\\\n\\\\t\\\\t\\\\t[T \\\\\\\"h2.subtitle.is-4\\\\\\\" \\\\\\\"Easy LISPing for Rapid App Development\\\\\\\"]\\\\n\\\\t\\\\t\\\\t[H \\\\\\\"a.button.is-outlined.is-large.is-inverted.is-warning.margin-10#try-btn\\\\\\\" \\\\n\\\\t\\\\t\\\\t\\\\t{[.onclick = ACTIONS.open-online-editor]} \\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\tTry Online\\\\\\\"\\\\n\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t[H \\\\\\\"a.button.is-outlined.is-large.is-inverted.is-warning\\\\\\\" \\\\n\\\\t\\\\t\\\\t\\\\t{[.href = \\\\\\\"https://github.com/GnsP/ironscript/archive/v1.2.2.tar.gz\\\\\\\"]} \\\\n\\\\t\\\\t\\\\t\\\\t\\\\\\\"Download v1.2.2.tar.gz\\\\\\\"\\\\n\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t] ] ]\\\\n\\\\t]\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"homepage.is\\\",\\\"content\\\":\\\"_module \\\\\\\"Main\\\\\\\"\\\\n (_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t(_use \\\\\\\"./virtualdom.is\\\\\\\")\\\\n\\\\t(_import \\\\\\\"./http.is\\\\\\\" _all)\\\\n\\\\n\\\\t[defun COMPONENTS.HomepageMain (props) (_begin\\\\n\\\\t\\\\t[render = \\\\n\\\\t\\\\t\\\\t[T \\\\\\\"section.section\\\\\\\" [H \\\\\\\".container\\\\\\\" {[.injectContent = (_try (ajax-get-file \\\\\\\"/homepage.html\\\\\\\") NIL ) ]} ] ]\\\\n\\\\t\\\\t]\\\\n\\\\t\\\\trender\\\\n\\\\t) ]\\\\n\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"tryonline.is\\\",\\\"content\\\":\\\"_module \\\\\\\"Try Ironscript Online\\\\\\\"\\\\n\\\\t\\\\n\\\\t(_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t(_use \\\\\\\"./virtualdom.is\\\\\\\")\\\\n\\\\n\\\\t(_import \\\\\\\"./actions.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./data-streams.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./flask.is\\\\\\\" _all)\\\\n\\\\t(_import \\\\\\\"./http.is\\\\\\\" _all)\\\\n\\\\t\\\\n\\\\t[SAMPLE-CODE-CACHE = {}]\\\\n\\\\t[defun get-sample-code-cached (uri) (_begin\\\\n\\\\t\\\\t[code = (_dot SAMPLE-CODE-CACHE uri)]\\\\n\\\\t\\\\t[if code then code else (_begin\\\\n\\\\t\\\\t\\\\t[ (_dot SAMPLE-CODE-CACHE uri) = (_try (ajax-get-file uri) NIL) ]\\\\n\\\\t\\\\t\\\\t(_dot SAMPLE-CODE-CACHE uri)\\\\n\\\\t\\\\t) ]\\\\n\\\\t) ]\\\\n\\\\n\\\\t[defun COMPONENTS.TryOnline (props) (_begin\\\\n\\\\t\\\\t[render = \\\\n\\\\t\\\\t\\\\t[T \\\\\\\".modal#online-editor\\\\\\\" \\\\n\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".modal-background\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".modal-content.wide-modal\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"section.section.lr-padded-50\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".columns.level\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".column.is-1.margin-10\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"img.image.is-64x64\\\\\\\" { \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[.src = \\\\\\\"./assets/logo.png\\\\\\\"] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[.alt = \\\\\\\"Ironscript\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".column.is-5.margin-10\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"p.title.is-3\\\\\\\" \\\\\\\"Ironscript 1.2\\\\\\\" [T \\\\\\\"sup\\\\\\\" \\\\\\\"Beta\\\\\\\"] ]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"p.subtitle.is-6\\\\\\\" \\\\\\\"Select sample program / write the code and click Run.\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".column.is-4.margin-10\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".field\\\\\\\" \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"label.label.is-small\\\\\\\" \\\\\\\"Sample Programs\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"span.control.is-expanded\\\\\\\" [T \\\\\\\"span.select.is-fullwidth\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"select#sample-program-selector\\\\\\\" {[.onblur = ACTIONS.select-sample-program]}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"option\\\\\\\" {[.value = \\\\\\\"./samples/default.is\\\\\\\"]} \\\\\\\"Default\\\\\\\"] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"option\\\\\\\" {[.value = \\\\\\\"./samples/hello-world.is\\\\\\\"]} \\\\\\\"Hello World\\\\\\\"] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"option\\\\\\\" {[.value = \\\\\\\"./samples/greets.is\\\\\\\"]} \\\\\\\"Greeting Somebody\\\\\\\"] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"option\\\\\\\" {[.value = \\\\\\\"./samples/factorial.is\\\\\\\"]} \\\\\\\"Factorial\\\\\\\"] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t] ]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t] \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".column\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"a.button.is-info.is-medium.is-pulled-right#run-code\\\\\\\" {[.onclick = ACTIONS.run-code]} \\\\\\\"Run\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"#editor\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"hr\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"h4.subtitle.is-5\\\\\\\" \\\\\\\"Output:\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".content#output\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\".is-clearfix\\\\\\\" [H \\\\\\\"a.button.is-warning.is-pulled-right#clear-output\\\\\\\" {[.onclick = ACTIONS.clear-output]} \\\\\\\"Clear Output\\\\\\\"] ]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t[H \\\\\\\"button.modal-close#editor-close-btn\\\\\\\" {[.onclick = ACTIONS.quit-online-editor]}]\\\\n\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t]\\\\n\\\\n\\\\t\\\\t[defun run (str) (_begin\\\\n\\\\t\\\\t\\\\t[prologue = @[ \\\\n\\\\t\\\\t\\\\t\\\\t(_sync (_use \\\\\\\"stdlib\\\\\\\") (_let _print @{\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar s = \\\\\\\"\\\\\\\";\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tfor(var i=0; i<args.length; i++) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif (typeof args[i] === 'string') s += args[i];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\telse s += JSON.stringify(args[i])+\\\\\\\" \\\\\\\";\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\ts += \\\\\\\"<br>\\\\\\\";\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tdocument.getElementById(\\\\\\\"output\\\\\\\").innerHTML += s;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t$return (s);\\\\n\\\\t\\\\t\\\\t\\\\t}@\\\\t) \\\\n\\\\t\\\\t\\\\t]@ ]\\\\n\\\\t\\\\t\\\\t\\\\n\\\\t\\\\t\\\\t[tmp = (_eval (+ prologue str) ) ]\\\\n\\\\t\\\\t\\\\tNIL\\\\n\\\\t\\\\t) ]\\\\n\\\\t\\\\t\\\\n\\\\t\\\\t[get-sample-program-uri = @{ var ret = document.getElementById(\\\\\\\"sample-program-selector\\\\\\\").value; $return (ret); }@ ]\\\\n\\\\t\\\\t[clear-output = @{ document.getElementById(\\\\\\\"output\\\\\\\").innerHTML = \\\\\\\"<div></div>\\\\\\\"; }@ ]\\\\n\\\\n\\\\n\\\\t\\\\t(_do (_on ACTIONS.open-online-editor ( @{ document.getElementById(\\\\\\\"online-editor\\\\\\\").className = \\\\\\\"modal is-active\\\\\\\"; }@ NIL ) ) )\\\\n\\\\t\\\\t(_do (_on ACTIONS.quit-online-editor ( @{ document.getElementById(\\\\\\\"online-editor\\\\\\\").className = \\\\\\\"modal\\\\\\\"; }@ NIL ) ) )\\\\n\\\\n\\\\t\\\\t(_do (_on ACTIONS.run-code (run (_pull DATA-STREAMS.source-code-stream) ) ) )\\\\n\\\\t\\\\t(_do (_on ACTIONS.clear-output (clear-output NIL) ) )\\\\n\\\\n\\\\t\\\\t(_do (_on ACTIONS.select-sample-program (_begin\\\\n\\\\t\\\\t\\\\t(_push DATA-STREAMS.sample-program-stream (get-sample-code-cached (get-sample-program-uri NIL) ) ) \\\\n\\\\t\\\\t) ) )\\\\n\\\\t\\\\t\\\\n\\\\t\\\\trender\\\\n\\\\t) ]\\\\n\\\"},{\\\"type\\\":\\\"file\\\",\\\"name\\\":\\\"footer.is\\\",\\\"content\\\":\\\"_module \\\\\\\"Footer\\\\\\\"\\\\n\\\\t\\\\n\\\\t(_use \\\\\\\"stdlib\\\\\\\")\\\\n\\\\t(_use \\\\\\\"./virtualdom.is\\\\\\\")\\\\n\\\\n\\\\t[defun COMPONENTS.Footer (props) (_begin\\\\n\\\\t\\\\t[render = \\\\n\\\\t\\\\t\\\\t[T \\\\\\\"footer.footer\\\\\\\" [T \\\\\\\".container\\\\\\\" [T \\\\\\\".content.has-text-centered\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"p\\\\\\\" \\\\n\\\\t\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"strong\\\\\\\" \\\\\\\"Ironscript\\\\\\\"] \\\\\\\" by \\\\\\\" [H \\\\\\\"a\\\\\\\" {[.href = \\\\\\\"https://gnsp.github.io\\\\\\\" ]} \\\\\\\"Ganesh Prasad (GnsP)\\\\\\\"]\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\\\\". The code is licensed \\\\\\\" [H \\\\\\\"a\\\\\\\" {[.href = \\\\\\\"http://opensource.org/licenses/mit-license.php\\\\\\\"]} \\\\\\\"MIT\\\\\\\"] \\\\\\\".\\\\\\\"\\\\n\\\\t\\\\t\\\\t\\\\t]\\\\n\\\\t\\\\t\\\\t\\\\t[T \\\\\\\"p\\\\\\\" [H \\\\\\\"a.icon\\\\\\\" {[.href = \\\\\\\"https://github.com/ironscript\\\\\\\"]} [T \\\\\\\"i.fa.fa-github\\\\\\\"] ] ]\\\\n\\\\t\\\\t\\\\t] ] ]\\\\n\\\\t\\\\t]\\\\n\\\\t\\\\trender\\\\n\\\\t) ]\\\\n\\\"}]}]}]}\"}");