I was reading some of the latest alarming info about global warming and its effect on the arctic here, when I came across this tidbit:
We’ve noted the passing of “talk like a pirate” day in previous years with not much more than a chuckle. This year, everyone at Cenqua got into the spirit and we had plenty of “harrr” and “shiver me timbers”. I hope I can revert to normal speech. Arrr, it bin fun.
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.
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.
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.