User loginNavigation |
call by ? and mental modelsWe've stopped to take a look at how Hecl handles procedures and their arguments. Since Hecl is a command-based language that takes a lot from Tcl, one obvious thing to borrow would call-by-name: set i 10 Currently, though, it does call-by-reference for destructive commands like 'incr': set i 10 Part of the thought behind this choice is that I want a consistent mental model for users, who I do not anticipate being programming language wonks, but rather those who would like to utilize Hecl to script applications for their cell phones, perhaps on a level on par with your average PHP user. In a language like PHP, variables always have a $ attached to them, which makes it easy for users to recognize that "that's a variable". I have a suspicion that Tcl's strategy of using foo here and $foo there may be confusing to new users, who must recall which one to use in which place. Furthermore, I am curious what references or lack thereof do to people's conceptual models of a language - having two variables point at the same thing. For instance PHP gives you the & operator to create a reference, C gives you pointers, Ruby and Python let you assign one thing to another and, in some cases, modify the thing pointed at by both variables. This also has me wondering what Scheme/Python/Ruby style pass by value with some kinds of values being modifiable is like for newer users... whether that makes sense or is confusing to have some kinds of things that can be changed, and others that can't. I'm currently searching for research and information on the topic, but in the meanwhile, what do you think? By David N. Welton at 2006-10-04 15:15 | LtU Forum | previous forum topic | next forum topic | other blogs | 6151 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 19 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago