News for hackers. Stuff that matters.
Re:Crema: A Sub-Turing Programming Language by adrusi on Wednesday August 05, 2015 @03:31PM (#10012236)
It would seem that you could implement that abstraction within the language

    def int int_indexing(int values[])[] {
        int i = 0
        int result[] = list_create(list_length(values))
        foreach (values as dummy) {
            result[i] = i
            i = i + 1
        }
        return result
    }
I haven't tested this, and I had to look in the source code to find the list_create function from the standard library. Of course, since the language lacks type parameterization, you'd need a different indexing function for each type of array.

There are no comments on this comment yet.