Skip to content

Commit

Permalink
REQUIRE julia 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
simonster committed Sep 26, 2016
1 parent b977d83 commit 72dd2b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
julia 0.4
Compat
5 changes: 2 additions & 3 deletions src/Memoize.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Memoize
export @memoize
using Compat

macro memoize(args...)
if length(args) == 1
Expand All @@ -12,12 +11,12 @@ macro memoize(args...)
error("Memoize accepts at most two arguments")
end

if !isa(ex,Expr) || (ex.head != :function && ex.head != @compat(Symbol("="))) ||
if !isa(ex,Expr) || (ex.head != :function && ex.head != Symbol("=")) ||
isempty(ex.args) || ex.args[1].head != :call || isempty(ex.args[1].args)
error("@memoize must be applied to a method definition")
end
f = ex.args[1].args[1]
ex.args[1].args[1] = u = @compat(Symbol("##",f,"_unmemoized"))
ex.args[1].args[1] = u = Symbol("##",f,"_unmemoized")

args = ex.args[1].args[2:end]

Expand Down

0 comments on commit 72dd2b2

Please sign in to comment.