What happened to "if-not"?
Posted: Fri Aug 30, 2013 2:44 pm
I see that if-not has been deprecated in the manual. But the code patterns document for 10.5.0 still mentions it.
Friends and Fans of newLISP
http://www.newlispfanclub.alh.net/forum/
http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=4391
Code: Select all
(if t1
c1
t2
c2
t3
c3
c4)
Code: Select all
(if test consequent alternative)
Code: Select all
(if-not t1
c1
t2
c2
t3
c3
c4)
Code: Select all
(if (not t1)
c1
(not t2)
c2
(not t3)
c3
c4)
Code: Select all
(if (not t1)
c1
t2
c2
t3
c3
c4)
(then the author goes off the rails a bit... :).The main difference to other programming language philosophies is, that some of newLISP's traits are influenced by thinking that is normally not found in the community of programming language geeks.
I think it is less about "consistency" or "it has feature x" as it is about categories like "beauty", "feeling right", "intuitivity", "learnability" etc. whereby the judges of these categories are not the only the geeks but the average user. People who are experts in other areas which are not programming languages...
Ah! It was all that svengali Kazimir's fault! :)cormullion wrote:Anyway, ricky, if-not was your idea in the first place!
I think this is my fault. Sorry. I didn't mean to be arguing a pedantic point (but I did). Here is the practical argument: I asked what (if-not t1 c1 t2 c2 ...) should mean, at the end of my last comment. I had not tested this before, but apparently in the current newLISP, it means that all arguments beyond the third one are ignored (i.e. if there is a third argument, it always will be "the else clause").cormullion wrote:You may indeed be technically correct ... You've not persuaded me that if-not should be removed at some unspecified time in the future ... just to make an important semantic point, or to remove one of the thousands of ways a new user can write bad code.
Code: Select all
> (if-not 1 2 3 4 5 6)
3
Code: Select all
> (if (not 1) 2 3 4 5 6)
4
And about "I missed any discussion of this proposal before," I too did not see any invitation to discuss this. AFAIK, people were not generally aware of if-not being deprecated -- I did not know until jopython mentioned it by opening this thread; so I think Lutz did not invite us to a discussion about it (or I missed it).cormullion wrote:I can't see any other benefit for removing it (from the code base or from the documentation) - how many bytes will it save? I missed any discussion of this proposal before - but I do remember arguing against changes that broke code for no good reason.
Hehehehe. Touche to my "I don't use if-not." :)cormullion wrote:Besides, I never use if in that ladder-like way anyway...
I agree with you in general about "leav[ing] unbroken things unfixed." Well, this discussion may be good for something: to save if-not! The alternative -- not having a discussion -- only leaves us on a cliffhanger about when (if ever) if-not bites the dust.cormullion wrote:I just get a feeling that this sort of discussion is energy going in the wrong direction. Forget this type of infelicity, leave unbroken things unfixed, and write some code, or a blog post, or something beneficial. That's what I'd say if I were in charge.:)
Code: Select all
Indefinite \In*def"i*nite\, a. [L. indefinitus. See In- not,
and Definite.]
[1913 Webster]
1. Not definite; not limited, defined, or specified; not
explicit; not determined or fixed upon; not precise;
uncertain; vague; confused; obscure; as, an indefinite
time, plan, etc.
[1913 Webster]
It were to be wished that . . . men would leave off
that indefinite way of vouching, "the chymists say
this," or "the chymists affirm that." --Boyle.
[1913 Webster]
The time of this last is left indefinite. --Dryden.
[1913 Webster]
2. Having no determined or certain limits; large and
unmeasured, though not infinite; unlimited; as, indefinite
space; the indefinite extension of a straight line.
[1913 Webster]
Though it is not infinite, it may be indefinite;
though it is not boundless in itself, it may be so
to human comprehension. --Spectator.
[1913 Webster]
3. Boundless; infinite. [R.]
[1913 Webster]
Indefinite and omnipresent God,
Inhabiting eternity. --W. Thompson
(1745).
[1913 Webster]
4. (Bot.) Too numerous or variable to make a particular
enumeration important; -- said of the parts of a flower,
and the like. Also, indeterminate.
[1913 Webster]
Indefinite article (Gram.), the word a or an, used with
nouns to denote any one of a common or general class.
Indefinite inflorescence. (Bot.) See Indeterminate
inflorescence, under Indeterminate.
Indefinite proposition (Logic), a statement whose subject
is a common term, with nothing to indicate distribution or
nondistribution; as, Man is mortal.
Indefinite term (Logic), a negative term; as, the not-good.
Syn: Inexplicit; vague; uncertain; unsettled; indeterminate;
loose; equivocal; inexact; approximate.
[1913 Webster]
So, I'm curious if you think that this reason alone is sufficient to deprecate if-not.Lutz wrote:Cannot remember having seen anybody actually using if-not, except myself. People just seem to prefer (if (not ...).
I agree. However, since if-not isn't cond-ish anyway (and probably wasn't touted as such in its manual entry), there wouldn't be any confusion on that point.Lutz wrote:It never worked with multiple true-clauses as the normal if does and if it would, it could be confusing.
Well, these days you don't have to rely on memory - just search the internet. For example, on Github, two repositories not unknown to the newLISP community - Artful-Code, and Dragonfly - both make use of this function. I use it too. So when the "indefinite" time comes, everyone who has used those repositories will be inconvenienced, for no very good reason (that you've given).Lutz wrote:Cannot remember having seen anybody actually using if-not, except myself.
Ah, so we all have to use VIM now?Lutz wrote:The VIM editor highlights it as deprecated.
and from the same pen:xytroxon wrote:It shall be so:
Madness in great ones must if-not unwatch'd go.
The Tragedy of Hamlet Cormullion, Prince of newLISP Act 3 Scene 1
If we do meet again, we’ll smile indeed.
If not, ’tis true this parting was well made.