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
! With local bindings (7 loc) | |
: merge ( x y z -- z ) | |
[| a b c | a b c a length 0 > b length 0 > and ] | |
[| a b c | a b c 0 a nth 0 b nth over over < | |
[| a b c x y | 0 a remove-nth b c x over push ] | |
[| a b c x y | a 0 b remove-nth c y over push ] if ] | |
while | |
[| a b c | a b c b length 0 = [| a b c | c a append ] [| a b c | c b append ] if ] call ; |
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
.LC0: | |
.string "%d" | |
.text | |
.globl main | |
.type main, @function | |
main: | |
.LFB0: | |
.cfi_startproc | |
pushq %rbp | |
.cfi_def_cfa_offset 16 |
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
document.body.appendChild(document.createElement('script')).src='http://code.jquery.com/jquery-1.4.3.min.js'; | |
setTimeout(function () { | |
$("textarea").after(function () { | |
return "<p style='color:blue;'>Word count: <b>"+$(this).val().split(/\s+/).length+"</b></p>" | |
}); | |
wc = function(ta) { ta.siblings().html('Word count: <b>'+ta.val().split(/\s+/).length+'</b>'); }; | |
$("textarea").keypress(function() { | |
wc($(this)); | |
} |
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
def add(x,y) | |
x+y | |
end | |
add(2,3) |
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
[:defn, | |
:add, | |
[:args, :x, :y], | |
[:call, [:lvar, :x], :+, [:arglist, [:lvar, :y]]]] | |
[:call, :add, [:arglist, [:lit, 2], [:lit, 3]]] |
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
λx.x |
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
λfx.f x |
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
λx.x | |
λy.y |
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
λx.x y | |
λy.y y |
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
λx.λy.x y (a b) | |
a b |