Monday, December 31, 2007

Whitespace separated lists

I'm trying to figure out a nice way to do lists in F++ while not requiring commas as separators and also taking advantage of the difference between \n and " " to avoid a layer of parens. By lists I really mean function argument lists and elements (I won't call them statements) in blocks of code. It seems like I should be able to make \n mean "next item in implicit list" but it's a bit tricky figuring out which list is the implicit list. Below are some examples of what I'd like to be able to write and what I'd like it to be equivalent to.

With whitepsace Explicit Notes
f 1 2 3 f(1, 2, 3) Nothing special.
f(1 g 2 3 4) f(1, g(2, 3), 4) The \n at the end of the "g" line terminates the g() function call and moves us onto the next argument for f().
{ x = f 1 y = f 1 2 3 z = f 1 2 \ 3 w = f g 2 3 v = f g 2 3 } { x = f(1); y = f(1, 2, 3); z = f(1, 2, 3); w = f; # still not sure if that's f or f() g(2, 3); v = f; g(2, 3); } Here the "z" line uses \ for continuation and so the \n is treated as just as list-separator space. The "w" line does not grab the "g". Neither does the "v" line because indentation is irrelevant!.

So what rules will result in parsing the above the way I want? Perhaps any explicitly delimited list containing a raw \n (ie not preceded by \) gets treated as 1 element per line and that's that. Or I could make function calls special. I think that's mainly where the fun is. Since they always start with a symbol, you know when you've encountered a function and if the symbol isn't followed by "(" then it ends at the next raw "\n". I can say a function call is symbol "(" args* ")" # separated by any kind of whitespace or symbol args* # separated by any whitespace except raw \n

Friday, December 14, 2007

Bjorn Lomborg - climate denier

Interesting article about Bjorn Lomborg, pointing out many (seemingly respectable) people's opinion that he is a deliberate bullshitter. While I have no reason to doubt it, it seems odd that someone who seems so scientifically dubious would be asked to give the first "Opinion" segment in Nature's podcast (4th Oct 2007, mp3, transcript). They did say in the introduction that they were interested in giving a platform to interesting voices but still...

Friday, December 07, 2007

Letter to the editor: bio-fuels vs food

Most of this comes from George Monbiot's recent article entitled "An Agricultural Crime Against Humanity".


James Gleason repeats his usual points about climate change (Monday
December 3rd) but for a change, I find we something to agree with -
the impact of bio-fuels on food supplies for the poorest people in the

The use of bio-fuel made from organic waste or grown on idle
agricultural land might have helped to reduce our use of oil but that
is not what is happening. Instead, land previously used to grow food
is being converted to grow fuel crops, in some countries, tropical
forests are being slashed and burned for the same purpose.

When you factor in the energy needed to farm and refine them with
current technologies, the environmental benefits of bio-fuels are
quite slim. Burning a forest to plant fuel crops eliminates the
benefit entirely and turns the whole thing into a net loss for the

Some foods can also be fuel crops, for example Swaziland is now making
fuel from casava while 40% of its people are facing food shortage.

Even the IMF is warning that demand for bio-fuel is pushing up food
prices for those who can least afford it.

Western governments must reevaluate their policies and targets for
bio-fuels and at the very least end subsidies,

Update:Published without edits I think.

Sunday, December 02, 2007

Letter to the editor: more climate change


Robert O'Sullivan complains about the "non-solution put forward" in my
letter. I put forward no solution at all in my letter, I am simply
trying to show that there is a real and urgent problem. He calls me an
"alarmist" but has yet to make any real argument that this is a false

Mr O'Sullivan brings up Homer Simpson's again. I agree that Homer has
something valuable to contribute. How we will have hamburgers if we
have to kill all of the farting cows? A funny question but with a
serious side to it.

I believe many people who deny the reality of man-made climate change
do not do so on the basis of scientific argument. They deny the
reality because they do not want to face questions like Homer's or
questions like "how will I have my holidays in the sun if I have to
pay for the full impact of the pollution it will cause?".

The fact is that someone must pay for it. Maybe it's someone in a
flood in Bangladesh or someone in California who's house has been
incinerated or someone in Tuvalu who's home disappeared below below
sea-level a few years ago. Or maybe it's a member of your family in
the Ireland of the future.

These are hard questions and we might not like the answers but the
longer we avoid them the greater the pain we will have to endure when
we are finally forced to deal with them.

I enjoy hamburgers and I enjoy travel, although I have already cut
back on my travel. I hope we can all continue to enjoy them but this
requires immediate action, not prevarication and denial,

Update:Published with some edits that probably improved it. Some fun going on in the comments on that page too. Next day, someone else calls Robert O'Sullivan clueless.

Saturday, December 01, 2007

Debate on academic boycott of Israel

Justin Podur covers a debate on whether an boycott of Israeli academic institutions is a good idea. This was held in a Canadian university, I get the impression that this debate simply couldn't take place in the US. Those opposed don't make a very good case and the question of where is the academic freedom of the Palestinians is a very strong counter to many of the anti-points.