Hacker News new | past | comments | ask | show | jobs | submit login

Well, it modifies greet in place.

And this:

    greet :: String -> String
Wouldn't really be writable by a human, because:

    x -> f x
Can represent any two expressions, for example:

  (addmatches! greet :chef-matches {:before :beginning}
    ((list? x) :sym) (comment Boolean -> Symbol)
    (list (apply greet x)) (comment Function -> Recursive...))
addmatches! isn't a separate function. Basically, at compile time, a macro is given the raw untyped tokens from Clojure's parser, and can run all of Clojure's features against them. The *match! macros don't exist at runtime.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: