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
The key idea behind Smalltalk isn't Objects as everyone thinks at first glance, it's messages, at least so says Alan Kay. Now it's easy to get confused about this as everyone knows Smalltalk is all about objects, objects and more objects, objects of all sorts, ham and spam, invoice and portfolio, objects of desire, fast cars and intimate relationships, objects of this and that, numbers are objects, and all manner of things object; and ultimately, uterly, completely, and finally fully purely objects. | |
That's Smalltalk. Not. You missed it. It's messages! That's why the syntax is the way it is. That's why there is a correlation between message sends and methods on the object. That's why unary, binary and keywords stitch together the Smalltalk world into an integral wholistic system so well. It's the messages. In Smalltalk we don't write objects. We write messages between objects! Smalltalk is a verb focused language not a noun based system. Yes it has objects, but they play second fiddle, verbs rule, eventhoug |
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 myfunc(options={}) | |
options = { | |
:a => 1, | |
:b => 2, | |
:c => 3 | |
}.merge(options) | |
# code goes here | |
end |
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
class PostQuery < Query | |
@@clauses = [:columns, :operations, :order] | |
def initialize(target_object) | |
super(target_object, @@clauses) | |
@clauses.each do |c| | |
class << self; self; end.define_method(c) { self[c] } | |
end | |
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
require 'rubygems' | |
require 'inline' | |
module Mult | |
VERSION = "0.1.0" | |
end | |
class Object | |
inline do |builder| | |
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
class Module | |
def +(other) | |
Module.new do | |
include self | |
include other | |
end | |
end | |
end |
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
.file "pink.c" | |
.text | |
.globl foo | |
.type foo, @function | |
foo: | |
pushl %ebp | |
movl %esp, %ebp | |
movl 8(%ebp), %eax | |
addl $1, %eax | |
popl %ebp |
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
module YCombinator | |
def y_comb(&generator) | |
proc { |x| | |
proc { |*args| | |
generator.call(x.call(x)).call(*args) | |
} | |
}.call(proc { |x| | |
proc { |*args| | |
generator.call(x.call(x)).call(*args) | |
} |
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
module YCombinator | |
def y_comb(&generator) | |
->(x){ | |
->(*args){ | |
generator.(x.(x)).(*args) | |
} | |
}.(->(x){ | |
->(*args){ | |
generator.(x.(x)).(*args) | |
} |
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
john@johnlinux ~ $ apt-cache search llvm | |
llvm - Low-Level Virtual Machine (LLVM) compiler for C/C++ | |
llvm-cfe - C front end for LLVM C/C++ compiler | |
llvm-doc - documentation for LLVM (Low-Level Virtual Machine) compiler | |
llvm-examples - examples using LLVM (Low-Level Virtual Machine) compiler | |
llvm-libs - common libraries for LLVM compiler for C/C++ |
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
llvm - Low-Level Virtual Machine (LLVM) compiler for C/C++ | |
llvm-cfe - C front end for LLVM C/C++ compiler | |
llvm-doc - documentation for LLVM (Low-Level Virtual Machine) compiler | |
llvm-examples - examples using LLVM (Low-Level Virtual Machine) compiler | |
llvm-libs - common libraries for LLVM compiler for C/C++ |