Skip to main content

All Questions

4 votes
2 answers
2k views

Multidimensional vs nested arrays

A seemingly basic question here. Is there anything you can do with multidimensional arrays that you can't do with nested arrays? Many languages have been designed with both facilities and syntactical ...
Steve's user avatar
  • 12.2k
8 votes
4 answers
4k views

What is the origin of counting from zero in programming languages?

This is a question which I have wondered (and been asked) about for a long time. In (most? all?) programming languages, an index begins at zero for an array, string, etc. I recognize it became ...
user avatar
1 vote
2 answers
2k views

What is VLA and how it is implemented?

Most languages does support variable length arrays on the heap but I've heard that those can be stored on the stack too. I'm curios what languages support this construct, some examples and how are ...
Cplusminus_is_coming's user avatar
0 votes
1 answer
234 views

If a variable containing a function gave the function's return instead of a reference to the function, what would an array of functions return? [closed]

I'm creating a prototype scripting language similar to something like Javascript. In my language, every single reference to a variable is actually a function call (a getter function), whether it has ...
dallin's user avatar
  • 412
4 votes
5 answers
597 views

What's the effect of this assignment (whatever the language)?

I think my book (Programming Languages: Principles and Paradigms) is wrong. a is a vector, assume a C-like language: b = 0; a[f(3)] = a[f(3)] + 1; int f(int n) { if(b == 0) { b = 1; ...
user34295's user avatar
  • 143
4 votes
3 answers
20k views

Subscript binding and array categories

I am learning "Programming languages principles" and there is a lot of information about stuff which make up a programming language . Unfortunately every material I came across until now has a lot of ...
progammer's user avatar
  • 751