Last active
December 27, 2015 23:39
-
-
Save ingydotnet/7406935 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
| # Snippet from https://github.com/ingydotnet/testml-tml/blob/master/function.tml | |
| test1 = (f, c, t) { | |
| List(f, '->', c).Join == t | |
| t.Strip(f).Strip('->') == c | |
| t.Strip('->') == List(f, c).Join | |
| } | |
| test1.Type == 'Func' | |
| Label = '$BlockLabel' | |
| test1(*fruit, *color, *thing) |
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
| # In quisp: | |
| (test1 = ( | |
| &[f c t] | |
| ((Join (List f '->' c)) == t) | |
| ((Strip (Strip t f) '->') == c) | |
| ((Strip t '->') == (Join List(f c))) | |
| ) | |
| ) | |
| ((Type test1) == Func) | |
| (Label = '$BlockLabel') | |
| (** [fruit color thing] (test1 *fruit *color *thing)) |
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
| --- | |
| - - test1 | |
| - = | |
| - - '&' | |
| - - Array | |
| - f | |
| - c | |
| - t | |
| - - Join | |
| - List | |
| - f | |
| - -> | |
| - c | |
| - == | |
| - t | |
| - - - Strip | |
| - - Strip | |
| - t | |
| - f | |
| - -> | |
| - == | |
| - c | |
| - - - Strip | |
| - t | |
| - -> | |
| - == | |
| - - Join | |
| - - List | |
| - f | |
| - c | |
| - - - Type | |
| - test1 | |
| - == | |
| - Func | |
| - - Label | |
| - = | |
| - $BlockLabel | |
| - - '**' | |
| - - Array | |
| - fruit | |
| - color | |
| - thing | |
| - - test1 | |
| - '*fruit' | |
| - '*color' | |
| - '*thing' |
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
| --- | |
| [ | |
| [test1, =, ['&', [Array, f, c, t], [ | |
| [[Join, [List, f, ->, c]], ==, t], | |
| [[Strip, [Strip, t, f], ->], ==, c], | |
| [[Strip, t, ->], ==, [Join, [List, f, c]]], | |
| ]]], | |
| [[Type, test1], ==, Func], | |
| [Label, =, $BlockLabel], | |
| ['**', [Array, fruit, color, thing], | |
| [test1, '*fruit', '*color', '*thing'] | |
| ] | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment