Skip to content

Commit

Permalink
Shaved off two lines thanks to @rjsamson
Browse files Browse the repository at this point in the history
  • Loading branch information
fogus committed Jun 6, 2013
1 parent f39fea2 commit aa16fca
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lithp.rb
Expand Up @@ -16,10 +16,7 @@ def apply fn, args, ctx=@env
end

def eval sexpr, ctx=@env
if ctx[:atom].call [sexpr], ctx
return ctx[sexpr] || sexpr
end

return(ctx[sexpr] || sexpr) if ctx[:atom].call [sexpr], ctx
fn, *args = sexpr
args = args.map { |a| self.eval(a, ctx) } if ctx[fn].is_a?(Array) || (ctx[fn].respond_to?(:lambda?) && ctx[fn].lambda?)
apply(fn, args, ctx)
Expand Down

2 comments on commit aa16fca

@rjsamson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha - awesome - I completely forgot I had done this!

@fogus
Copy link
Owner Author

@fogus fogus commented on aa16fca Jun 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dove into the forks and found it floating around. Thanks for that. :-)

Please sign in to comment.