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
c = new Compiler({ | |
debug: "gcc -O0 -g -Werror -Wall blabla", | |
release: "gcc -Os -march=blabla blabla", | |
}); | |
c.add_files("*.c"); | |
c.build(); |
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
monkey_patch: { | |
.my_new_method: () { lol } | |
} | |
if MyObject | |
MyObject.instance_eval &monkey_patch | |
else | |
MyObject: class &monkey_patch | |
end |
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
MyBase: class { | |
.some_method: (a) { | |
return a + 2 | |
} | |
} | |
MyObject: class { | |
.prototype: MyBase | |
// Method 1 |
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
str: load_input // or whatever -- we have a string with newline-separated words | |
// The worker task for mapreduce | |
calculate_length_task: (task) { | |
message: task.pop // Blocks until there is a message | |
if message = "get_length" // Operator = overloaded for Message class | |
task.yield message.args[0].length | |
else | |
task.yield null | |
end |
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
IRCBot: class { | |
initialize: (server, channel, nick) { | |
.server, .channel, .nick: server, channel, nick | |
} | |
connect: () { | |
.socket: /* blablabla */ | |
} | |
send_message: (msg) { |
NewerOlder