This file contains 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
:: +cache-key: a key for looking up a build in the cache | |
:: | |
+= cache-key | |
$: sub-results=(list build-result) | |
$% [%$ literal=cage] | |
[%alts ~] | |
[%bake renderer=term query-string=coin path-to-render=rail] | |
[%bunt mark=term] | |
[%call ~] | |
[%cast mark=term] |
This file contains 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
=> |% | |
+$ result | |
%+ each * | |
:: | |
$: blocks=(set [=term =beam]) | |
:: | |
$= continuation | |
$- (map [=term =beam] (unit cage)) | |
result | |
== |
This file contains 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
|% | |
+$ nock-func $-(subject=* result=*) | |
+$ cps-formula $-([subject=* next=nock-func] result=*) | |
-- | |
|% | |
++ nock-to-cps | |
|= fol=nock | |
^- cps-formula | |
:: | |
?- fol |
This file contains 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
:: start with some data from the lexical subject | |
:: | |
=/ a=@ 2 | |
:: a ford rune produces a +schematic:ford | |
:: | |
^- schematic:ford | |
:: /? produces a %reef at that version | |
:: | |
/? 310 | |
:: /+ prepend expression into subject (like =+ for ford) |
This file contains 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
:: $type: a hoon type, represented in noun form | |
:: | |
:: Instead of lazily evaluating the type of a hoon when compiled against a | |
:: subject type, use the special value %loop to recurse back up to the | |
:: nearest %hold. | |
:: | |
+$ type | |
$@ ?(%noun %void %loop) | |
$% [%atom p=term q=(unit @)] | |
[%cell p=type q=type] |
This file contains 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
|% | |
+$ op | |
$@ $? %bail :: error out | |
%call :: =+ gate=pop =+sample=pop (gate sample) | |
%cons :: =+ head=pop =+ tail=pop [head tail] | |
%copy :: duplicate top of stack | |
%done :: halt (successfully) | |
%eval :: eval top of stack as schematic against next top as subject | |
%numb :: catch error | |
%swap :: swaps top two elements of stack |
This file contains 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
A noun is an atom or a cell. An atom is a natural number. A cell is an ordered pair of nouns. | |
Reduce by the first matching pattern; variables match any noun. | |
nock(a) *a | |
[a b c] [a [b c]] | |
?[a b] 0 | |
?a 1 | |
+[a b] +[a b] |
This file contains 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
|% | |
:: +make-diff: create a noun representing the diff from :a to :b | |
:: | |
++ make-diff | |
|= [a-vase=vase b-vase=vase] | |
^- vase | |
:: | |
?> (~(nest ut p.a-vase) | p.b-vase) | |
?> (~(nest ut p.b-vase) | p.a-vase) | |
:: |
This file contains 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
var monkeyPatches = { | |
'_livedata_data': 'DATA', | |
'_livedata_error': 'ERROR', | |
'_livedata_nosub': 'NOSUB', | |
'_livedata_connected': 'CONNECTED', | |
'_livedata_result': 'RESULT', | |
}; | |
_.each(_.keys(monkeyPatches),function(funcName){ | |
var modifiedFunctionName = funcName+'_original'; | |
var extension = {}; |
This file contains 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
|% | |
++ mebe | |
|* a=mold | |
|% | |
+$ form (unit a) | |
++ pure | |
|= arg=a | |
^- form | |
`u=arg | |
++ bind |