Arc Forumnew | comments | leaders | submitlogin
1 point by eds 6117 days ago | link | parent

> Dynamic binding seems so intuitive to me. Why isn't it the default binding?

From http://www.findinglisp.com/blog/2004/05/special-vs-lexical-v... :

"In the old days, they say (I wasn't there), many Lisps had only special variables (are they really that special when they're all you have?). The problem is that bugs associated with the dynamic/special behavior are quite difficult to debug. You can have one part of the program affect another part and it isn't clear what the connection between the two is unless you're looking at the call graph."

> Have I missed an elegant solution that doesn't make the code bigger, harder to read or not thread-safe?

Perhaps CL style special variables? You can reference them without extra code (although you need naming conventions to prevent mixing lexical and special variables), and I think most CL implementations automatically make thread-local copies when using special variables in a thread. (See the rest of that article I linked above.)



1 point by jazzdev 6116 days ago | link

>The problem is that bugs associated with the dynamic/special behavior are quite difficult to debug. You can have one part of the program affect another part and it isn't clear what the connection between the two is unless you're looking at the call graph.

Yep, that's a reasonable argument for a language designed for average programmers. But if Arc is designed for expert programmers then I think expert programmers will want to make a different trade-off. I'll risk shooting myself in the foot to get a more powerful language.

> Perhaps CL style special variables?

Yep, that would be good. That would be adding dynamic binding to Arc.

-----

1 point by almkglor 6116 days ago | link

http://arclanguage.com/item?id=2497

-----