Re: List syntax (was: Re: help from the community?)

2007-02-02 Thread Kirsten Chevalier

On 2/2/07, Douglas Philips [EMAIL PROTECTED] wrote:

I assert that the trailing comma is a feature, not a programmer
forgetting the last element, and that this
is already explicitly allowed, as per the syntax fragments already
quoted, repeated here for convenience:

-- from: http://www.haskell.org/onlinereport/syntax-iso.html#sectB.4
impspec -   ( import1 , ... , importn [ , ] )   (n=0)
|hiding ( import1 , ... , importn [ , ] )(n=0)
exports -   ( export1 , ... , exportn [ , ] )   (n=0)



Huh? I don't quite see what you're getting at here. The report says
that the trailing comma is allowed in import and export lists, yes.
But you were talking about trailing commas in lists and tuples, which
would be a change to the existing language, not something that's
already explicitly allowed. Can you clarify what you meant?

Cheers,
Kirsten

--
Kirsten Chevalier* [EMAIL PROTECTED] *Often in error, never in doubt
and there's too much darkness in an endless night to be afraid of the way we
feel -- Bob Franke
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: List syntax (was: Re: help from the community?)

2007-02-02 Thread Kirsten Chevalier

On 2/2/07, Douglas Philips [EMAIL PROTECTED] wrote:

Hmmm...stated another way:
I am proposing that the list and tuple syntax change to be consistent
with the import and export syntax.
The argument that a trailing comma means the programmer forgot the
last item in a list / tuple is
inconsistent with the deliberately explicit permissiveness of a
trailing comma in the import / export lists.
In the import / export lists such a trailing comma does not mean
programmer forgot additional thing at the end.



Ok, now I see your point. I agree it does seem inconsistent. I don't
know the reasons for the choice to make the import/export lists work
that way, but I would guess that it's because when people use
import/export lists, they often add/remove items from the lists, and
allowing the trailing comma just makes things easier. On the other
hand, with constant lists and tuples, you're probably not going to
frequently edit the same constant list value. Am I missing something?

Cheers,
Kirsten

--
Kirsten Chevalier* [EMAIL PROTECTED] *Often in error, never in doubt
The world is absurd and beautiful and small -- Ani DiFranco
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: List syntax (was: Re: help from the community?)

2007-02-02 Thread Kirsten Chevalier

On 2/2/07, Douglas Philips [EMAIL PROTECTED] wrote:

On 2007 Feb 2, at 1:03 PM, Neil Mitchell indited:
 An import list is not a value, you can't examine whats in the list,
 you can't enumerate it etc. As such, it doesn't really matter how many
 elements are in there, the important thing is what the elements are.

I don't know enough about it, but mightn't Template Haskell disagree
on that point?
Or any other source-level manipulators? (perhaps that shouldn't be a
consideration?)



Well, Template Haskell is an extension and not part of the current
Haskell 98 standard. And as far as I know there's no effort to make it
part of Haskell Prime. So yeah, probably it shouldn't be a
consideration.


You just highlighted the inconsistency:
You refer to import lists... you appear to think of the import
syntax _as a list_,
and it is precisely that mental processing where the inconsistency
hits/grates.
If it is an import _list_ it can have trailing commas, but if it is
some other _list_, it can't.
I don't see the justification for making those two cases different.


The thing that I think Neil and Ganesh were trying to get at is that
an import list can't appear in just any context (that's what's meant
by it not being a first-class value), so Haskell programmers *do*
usually think about them differently.

Cheers,
Kirsten

--
Kirsten Chevalier* [EMAIL PROTECTED] *Often in error, never in doubt
Man, you're not so perfect / Man, you're not a pearl / You're nothing
more, man, than a little piece of sand / That grew up inside of a girl
-- Jude
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime