Last active
August 29, 2015 14:22
-
-
Save zaphar/bfe174b4aba4f4ed5fd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
++ showbadcode | |
|= [code=tape] | |
=+ ^= result | |
(mule |.((slap !>(.) (ream (crip code))))) | |
?: ?=(%.y -.result) | |
=+ good=p.result :: successful! | |
;code | |
;pre: {code} | |
;pre: product => {<good>} | |
;pre: result => {~(ram re (sell good))} | |
== | |
=+ error=p.result :: Oh noes it didn't work. | |
;code | |
;pre: {code} | |
;* %+ turn | |
error | |
|= a=tank | |
^- manx | |
;pre: error: {~(ram re a)} | |
== | |
++ testbadcode | |
(showbadcode "=+(a=1 a)") | |
:: Usage example below. | |
;pre: {<testbadcode>} :: this works and outputs: [[%code ~] [[%pre ~] [[%~. [%~. "=+(a=1 a)"] ~] ~] ~] [[%pre ~] [[%~. [%~. "product => "] ~] ~] [[%~. [%~. "[p=#t/@ud q=1]"] ~] ~] ~] [[%pre ~] [[%~. [%~. "result => "] ~] ~] [[%~. [%~. "1"] ~] ~] ~] ~] | |
;- testbadcode :: This causes a type-fail error | |
;- %- showbadcode """ :: This also causes a type-fail error. | |
=+ a=1 | |
b | |
""" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment