Arc Forumnew | comments | leaders | submitlogin
What's the purpose of hook?
1 point by lark 4822 days ago | 4 comments
I don't see any reason for hook to be in news.arc.

What am I missing?



1 point by akkartik 4822 days ago | link

I gather it's intended to be a way to dynamically extend behavior on various events.

http://files.arcfn.com/doc/variables.html#defhook

You're right that it isn't used in the codebase, but perhaps it's used at the REPL or something like that.

-----

1 point by thaddeus 4822 days ago | link

http://arclanguage.org/item?id=11590

Lol... I remember asking the same thing.

-----

1 point by lark 4821 days ago | link

That answer has no conclusion though. I still don't see why one can't just call the function they want.

news.arc does not dynamically add and remove hooks, so the hook abstraction seems redundant. And the defhook macro is unused.

My conclusion is that hooks were something to experiment with originally, and later back away from.

-----

1 point by akkartik 4821 days ago | link

Another possibility is that hooks are prone to change and so weren't released.

-----