> I knew of the namespace collision effect.
> But one has to choose between the bad and worse.
>
> And in any case, there remain too many ways to error.
> We also may paste
> True :: Bool instead of False
> (the type design does not help),
> x / 0 instead of x / 2,
> take n xs instead of take (-n) xs
> We also may forget to write a program and try to use it.
Do you really believe the general principle that `if something is
inherently error prone then something is only worth doing if it solves all
the errors completely, not if it only makes things slightly less error
prone?' That would suggest that strong typing, haskell style modules and
numerous other innovations are mistakes made in the language design
process.
>
> Generally, concerning the mode argument: looks like the Haskellites
> avoid it. I am just trying to understand what is going on.
>
> Why people do not complain on the mode argument outside of Haskell:
> `zip -r ...' `unzip -t xxx.zip' `tar xvfz xxx.tar.gz'
You're talking to someone who has about a hundred one line perl scripts
that replace `command -acnse ' type things with meaningful names :-)
> And it is definitely not good to have several functions in the
> interface instead of several mode values for one function.
I'll admit I'm not sure either way on that one, but mode values really
should to be typed.
> data ModeQuotRem = QuotRem_minRem | QuotRem_positive | QuotRem_other
> deriving(Eq,Ord,Enum,Show,Read)
> -- contrived
>
> data Mode_sort = Sort_quick | Sort_merge | Sort_insert | Sort_other
> deriving(Eq,Ord,Enum,Show,Read)
> ...
> Again, `Positive' would not do, it should be something like
> QuotRem_Positive, and so on.
The only collision here if you remove the QuotRem_ & Sort_ prefixes comes
from the other, which seems like excess generality to me: do you really
want an option to use a QuotRem function in a mode about which you know
nothing. If Fergus' suggestion about allowing overloaded data constructors
for H-2 is allowed then I've no problem with multiple instances of
Positive since each use point have a meaning which matches the
natural/technical language meaning of `positive', and will start ringing
alarm bells in my head if what I meant was `negative'. The problem with
chars is if for example `p' means positive (ie >=0) in one function and
strictly-positive (ie >0) in another: I don't think you can have both
mnemonic value and collision freeness in a namespace with effectively 26
values.
___cheers,_dave________________________________________________________
www.cs.bris.ac.uk/~tweed/pi.htm|I shoulda realised building the
email: [EMAIL PROTECTED] |memory allocation subsytem with
work tel: (0117) 954-5253 |--with-malicious-ai was a bad idea.