Why US-Only?

I was catching up on my gadget news today on Engadget and thought I’d checkout the new Amazon video service. As I expected, this is a US-only service:


Maybe there is a good reason of which I am unaware. I’m too cynical to think of one. You’d hope our Free Trade Agreement with the US would actually give us some benefits and not just additional restrictions.

Drought Breaker

Large parts of Australia have been gripped by a drought on and off for quite a while now. In Sydney we have water usage restrictions and for a while there, we were getting regular reports on the dam levels.

Anyway, it turns out that I have been able to bring at least a temporary respite to this drought. All I had to do was plan a short camping trip many months ago. As the day arrived, we’ve been enjoying regular long rain periods and a return to cold weather. So, drought broken and camping postponed – oh well !

This post also serves to break my blogging drought.

VB.Net Keywords

The VB.Net grammar has always had, at least for me, a strange approach to keywords. In contrast to many languages, VB allows you to, at least at the syntactic level, use keywords for identifiers in many situations. I guess it may have been to allow maximum operability with libraries implemented in other .NET languages.

The latest spec removes a lot of keywords while retaining their use within the grammar. C# also uses this technique of “context sensitive keywords”. Overall it’s a bit of a pain as you generally need to play games between the lexer and parser stages to make it work. Today I’m going to look at the preserve keyword which is, alas, not preserved.

A long time ago, in University, I used a book “Principles of Programming Languages” by Bruce MacLennan. It’s way out of date by now but I remember still how it put forth a set of priciples for langauge design including classis such as the zero-one-infinity principle. Anyway, one of the principles was “The regularity Principle: regular rules, without exceptions, are easier to learn, use, describe and implement”

The dropping of preserve as a keyword allows us to create a program which, I think, violates this principle:

Imports System

Module Test
Public Sub Main()
Dim preserve(2, 2) as integer
redim preserve(2, 4)
End Sub
End Module

This will not compile with my current version of vbc 2.0. If I change the name of the variable, however, it will. Isn’t that odd? I’m not sure of the motivation for removing the keywords when it really does seem to want to be a keyword.