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
~/scowl-6/final % egrep -h '([^s]s|z|j)ure$' * | sed 's/[sz]ure$/jure/g' burke@zaphod (18:09) | |
Rajure | |
Yurujure | |
enjure | |
meajure | |
clojure | |
expojure | |
injure | |
leijure | |
pleajure |
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
irb(main):001:0> require 'archive/tar' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/archive-tar-0.9.0/lib/archive/tar/reader.rb:17: warning: else without rescue is useless | |
SyntaxError: /opt/local/lib/ruby1.9/gems/1.9.1/gems/archive-tar-0.9.0/lib/archive/tar/reader.rb:15: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' | |
when IO: parse(@source, full); @source.rewind | |
^ | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/archive-tar-0.9.0/lib/archive/tar/reader.rb:34: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' | |
when :file: File.open(path, 'w') { |fio| fio.write(body) } | |
^ | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/archive-tar-0.9.0/lib/archive/tar/reader.rb:35: syntax error, unexpected keyword_when, expecting keyword_end | |
when :directory: FileUtils.mkdir(path) |
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
#!/usr/bin/env ruby | |
# -*- mode: ruby -*- | |
# Copyright Burke Libbey 2009, MIT License. | |
HOME_DIR = "/Users/burke" # Home directory | |
SVN_DIR = "#{HOME_DIR}/src/clojure/svn" # Clojure SVN checkout path | |
BRANCHES_DIR = "#{SVN_DIR}/branches" # Clojure SVN branches path | |
TRUNK_DIR = "#{SVN_DIR}/trunk" # Clojure SVN trunk path | |
INSTALL_DIR = "#{HOME_DIR}/lib/clj" # Path to managed jar symlinks |
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
lambda{|n| n.zero? ? 1 : n * self.call(n-1)} |
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
fac = lambda{|n| n.zero? ? 1 : n * fac.call(n-1)} |
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
# Ruby 1.8.7 | |
lambda{|n| (fac=lambda{|n| n.zero? ? 1 : n * fac.call(n-1)}).call(n) } | |
# Ruby 1.9 | |
->(n){(fac=->(n){n.zero? ? 1 : n * fac.(n-1)}).(n)} |
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 Y | |
lambda { |f| f.call(f) }.call( | |
lambda do |g| | |
yield(lambda { |*n| g.call(g).call(*n) }) | |
end) | |
end | |
Y { |this| lambda { |n| n == 0 ? 1 : n * this.call(n - 1) } }.call(12) | |
#=> 479001600 |
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
(λ f. f 3) (λ x. x + 2) |
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
# Ruby 1.8.7 | |
lambda{|f| f[3]}[lambda{|x| x+2}] |
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
# Ruby 1.9 | |
->(f){f.(3)}.(->(x){x+2}) |
OlderNewer