Skip to content

Instantly share code, notes, and snippets.

View devyn's full-sized avatar
🚴
does the Highway Code apply to the Information Superhighway?

Devyn Cairns devyn

🚴
does the Highway Code apply to the Information Superhighway?
View GitHub Profile
number :: 0x[0-9a-fA-F]+
0b[01]+
0[0-7]+
[0-9]+
<number> ^ <number> := number { |base, exponent|
result := 0
$exponent times {
result := $result * base
--[
(int) + (int)
(string) + (int)
are completely different patterns
]--
(int) + (int) := { |a, b|
-- code here
}
(int) + (int) := int { |int a, int b|
if ${$a within 1 and 10}:
-- ...
else:
next
}
(int) + (int) := int { |int a, int b|
if ${$a within 11 and 20}:
-- ...
define #factorial
if [= n 0]
return 1
else
* n [factorial [- n 1]]
// dependent typing theory.
null print(string s) external
string readFile(string pathName) external
null printWithReq(string s : s.length > 50) {
print(s)
}
display:
stdout {0} io.create
stdout <<1 input
stdout io.write
stdout {"\n"} io.write
void << stdout
require 'rubygems'
require 'nokogiri'
InkscapePath = 'C:\Program Files\Inkscape\inkscapec.exe'
InputFile = ARGV.shift
if InputFile.nil?
abort "No input file specified."
end
-- Since all primitives are immutable, we use this if we want a mutable list. (like Erlang)
proc DynamicList: items -- this declares 'items' as being a variable shared among all of the invokers, but fixed to this instance
items = {}
loop
select self -- receive from 'self' and do a switch
:add
item = self -- = combined with a channel (in this case, self, which is used to communicate with the invoker) receives
items = list.join items {item} -- a space means to send, therefore, we can send things to list.join and receive all on one line
self true true -- send true and true to the invoker (first true: we understood the message, second true: it ran successfully)
kill list.join -- kill the process, kill all of its subprocesses, free memory. not necessary at end of program, things are automatically collected at the end.
require 'formula'
class Cairo <Formula
url 'http://cairographics.org/snapshots/cairo-1.9.6.tar.gz'
homepage 'http://cairographics.org/'
md5 '796dc87c4e78245e8c92debf6a65d63d'
# depends_on 'cmake'
depends_on 'pixman'
DevBook devyn (~/Projects/shoes master⚡): bin/main
dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
Expected in: /Users/devyn/Projects/shoes/deps/lib/libjpeg.62.dylib
in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
zsh: trace trap bin/main