Hacker News new | ask | show | jobs
by kingofmen 61 days ago
What the devil kind of "Nynorsk" allows "kalkuler" in place of "beregn"? And as the other poster pointed out, 'endre' does not actually take the '-leg' ending to make an adjective; not in the written language at least. Your dialect may allow it but that hardly matters. Try 'foranderlig', although I do like the idea of using articles. However, as we have three articles but variability is binary, I suggest we assign 'en' (masculine, firm, rigid) to constants, 'et' (neuter, indecisive, wibbly-wobbly) to variables, and of course 'ei' (feminine) as referring only to collections, into which things may be inserted. That does leave us with the difficulty of how to declare a collection as constant; I suggest

`ei fylke er alltid ["Vestland", "Rogaland", "Troms", "Finnmark"]`

which on second thought suggests that we can just have `alltid` as a const-modifier on `er`. Simpler.

Another point to note is that Norwegian does not allow the Oxford comma; correct grammar is "Johan, Fredrik og Martin". To follow this rule you should require the last separator of a list to be 'og':

`ei fylke er alltid ["Vestland", "Rogaland", "Troms" og "Finnmark"]`

2 comments

This tickles me:

> `ei fylke er alltid ["Vestland", "Rogaland", "Troms" og "Finnmark"]`

Might even consider adding that.

I have renamed the "endreleg" since the article release to "låst" and "open".

The thought process was:

- Variabelen er låst for endringer.

- Variabelen er open for endringer.

But I really like the "alltid" suggestion.

> I have renamed the "endreleg" since the article release to "låst" and "open".

I like that - much shorter and also the two keywords are the same length, which is always nice when you're making a list. I have to say I would prefer 'åpen', though, just to make extra trouble for people who don't have a keyboard with Correct letters on it. :D

A further thought on `alltid` - you could add the keyword `aldri`, which makes it a runtime error for the variable to take that value. Maybe add ranges as well, for easy bounds checking, e.g.

``` en peker er aldri = null en indeks er aldri > 5 ```

That is kinda interesting as a concept tbh.

  open peker er 10
  peker er aldri < 5
  peker er aldri > 10
  // Masse kode
  peker er 30 // Error 
Or alternatively:

  open peker er 10
  peker er aldri < 5 eller > 10
  // Masse kode
  peker er 30 // Error
This is the kind of quality response that makes HN great.
Yeah, this is HN at its peak, commentary on a Norwegian based programming language in English :D