logoalt Hacker News

atomfingeryesterday at 1:34 PM1 replyview on HN

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.


Replies

kingofmenyesterday at 8:44 PM

> 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 ```

show 1 reply