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
# Definition | |
immutable Curried{N} | |
func::Function | |
end | |
Base.call(cf::Curried{1}, arg) = cf.func(arg) | |
Base.call(cf::Curried{1}, arg, args...) = error("Wrong numbers of arguments in curried function.") | |
Base.call{N}(cf::Curried{N}, arg) = Curried{N-1}(cf.func(arg)) |
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
#============================================================# | |
# detailed() | |
# prints expanded tests with average time, | |
# minimum time, maximum time, and result. | |
# | |
#------------------------------------------------------------ | |
# summarized() | |
# prints average times. | |
# | |
#============================================================# |
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
any([false for x = 1:100000]) | |
#---------------------------------------------------------------- | |
# old any | |
#---------------------------------------------------------------- | |
result = false | |
average time = 279.591 microseconds | |
maximum time = 6.349 milliseconds | |
minimum time = 167.085 microseconds |
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
#---------------------------------------------------------------- | |
# any([false for x = 1:100000]) | |
#---------------------------------------------------------------- | |
old any = 274.780 microseconds | |
new any V1 = 400.905 microseconds | |
new any V2 = 329.738 microseconds | |
new any V3 = 358.323 microseconds | |
new any V4 = 289.087 microseconds | |
#---------------------------------------------------------------- |
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
ematch(:(a+b = c), :(a+b = c)) | |
ematch(:(a+b = c), :(1+2 = 3), variable=:?) | |
ematch(:(a+b = c), :(1+2 = 3)) | |
ematch(:(a,b), :(b,a)) | |
ematch(:(a::!,b), :(b,a)) | |
ematch(:(a::!,b), :(a,a)) | |
ematch(:(a::?+b = c::?), :(1+b = 3), variable=:?) | |
ematch(:(a::?+b = c::?), :(1+d = 3), variable=:?) | |
ematch(:(x,x), :(1,2)) | |
ematch(:((x::&),x), :(1,2), consistency=true) |
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 ErrorTest | |
# VectorStream | |
type VectorStream{T} | |
vector :: Vector{T} | |
current :: Integer | |
VectorStream(vector) = new(vector, 0) | |
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
#!julia | |
include("version_check.jl") | |
""" | |
Translate between replays of Lemmini and SuperLemmini (when possible). | |
Interactive Usage: | |
LemmingReplayTranslator.translate("input.rpl", "output.rpl") # or: | |
LemmingReplayTranslator.main() #then write out the filenames as requested | |
CommandLine Usage: |
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
# julia 0.5 only! | |
module GeneratedPartial | |
export @partialize, partialize, ? | |
const MAX_UNDERSCORE = 10 | |
macro times(n,action) | |
:(Any[$action for _ in 1:$n]) | |
end | |
mapquote(f, l) = quote $((map(f,l))...); end |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
## Note: This code is outdated and unmantained! | |
## Go here for the new version: https://github.com/fcard/SelfFunctions.jl | |
module SelfFunctions | |
export @selftype | |
immutable SelfFunction{F <: Function} | |
name::Symbol | |
typ::DataType | |
f::F |
OlderNewer