On Dec 8, 2007, at 9:06 , Richard Hainsworth wrote:

or not quite right. And there is absolutely no linguistic link between 'switch' and 'case'. If I am uncomfortable with 'switch', 'case' really sucks. In fact, whenever I work in language other than perl, and 'switch' is the preferred construct, I always have to check the syntax to work out what goes where.

Actually, before C the construct was usually case ... when; compare, for example, Algol (/bin/sh lifted its case construct from Algol68, IIRC). (And see below.)

b) 'Given' is more commonly used in English as a verb form. 'He was given an award'. Also, it is in the correct form for use at the beginning of a sentence, eg., 'Given three choices, he chose the most profitable'. So we have something that looks and feels like it is a part of normal English speech. The 'when' part is also a natural tag in English indicating one of several alternatives. 'Given' can be used as noun (the power of English! as a language) as in 'we have a number of givens, but the issue is still unresolved'. This is much rarer than the use of 'given' in verb uses.

It is worth noting that given ... when is a way in which I would (and indeed have) expressed this *in English*, as opposed to when programming. (As is case ... when, but as an abbreviation of "in/ *given* the case of <blah>, when <foo>...".)

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university    KF8NH


Reply via email to