From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14910 invoked by alias); 10 Jan 2015 22:21:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34223 Received: (qmail 18787 invoked from network); 10 Jan 2015 22:21:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=T/C1EZ6Q c=1 sm=1 tr=0 a=409km5Jzyi9hcadZZk99kQ==:117 a=409km5Jzyi9hcadZZk99kQ==:17 a=Hpgzp-inWqAA:10 a=N659UExz7-8A:10 a=KXnPPuGGwlQUQQn0AUwA:9 a=pILNOxqGKmIA:10 Message-id: <54B1A5EC.2080202@eastlink.ca> Date: Sat, 10 Jan 2015 14:21:32 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-version: 1.0 To: zsh-workers@zsh.org Subject: Re: Math expression evaluation error? References: <54B03024.1030309@gmail.com> <20150109201552.1304eafe@ntlworld.com> <54B04ADA.9050102@gmail.com> <54B05407.7090303@eastlink.ca> <775A96D9-12A6-499B-8AAB-B2431F13701D@larryv.me> <54B069A9.2040504@eastlink.ca> <54B0D451.1000502@eastlink.ca> <150110085320.ZM28012@torch.brasslantern.com> <54B173ED.20301@eastlink.ca> <150110111445.ZM21328@torch.brasslantern.com> In-reply-to: <150110111445.ZM21328@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 01/10/2015 11:14 AM, Bart Schaefer wrote: > On Jan 10, 10:48am, Ray Andrews wrote: > } > } is just to ask: What is most useful? What would produce the maximum > } utility along with the least surprise, especially for a new user? In > } which direction is 'the future'? > > Call me a cynic or a curmudgeon as you prefer, but the future of new > users who would give so little thought and study to the tools they > are using as to find this a problem more than once, is to not use > shells at all. That's quite legitimate. The 'fix' is after all very simple. You know, in this sort of discussion pressures can build beyond what the issue merits. 'setopt force_float' and there's nothing more to worry about. But so long as you wish to discuss it, I'll just do what I do and advocate for a friendlier and more intuitive shell where possible: However simple the fix may be, it remains my view that the intuitive behavior should be the default. It's just my paradigm. I quite understand that it will not prevail. Not worth the price of a beer, and certainly not worth any disturbance. > > It *is* probably less than ideal that "zcalc -f" is not the default And that's all I'm saying, (but, for "$ (( ))" too). BTW, just Googling, I see that this issue has come up time and again. Our original poster on this thread is not the first person to be got by this gotcha. Why not make the issue go away, once and for all? One could have fun with some facetious advertising: "Try zsh, the shell where 1/2 + 1/2 = 1 !!!" > for the actual calculator utility; but pretending that $(( ... )) could > ever be described "a calculator with no surprises or gotchas" regardless > of integer arithmetic, is misleading because it isn't a calculator and > trying to think of it that way is going to cause surprises and gotchas. Well, it could come to a question of terminology or even of hard facts. I myself have (until this issue came up) never done anything beyond simple integer addition and subtraction. From what I read, $ (( )) does quite sophisticated calculations and it is ergo, ipso facto a calculator. And I also presume that it accesses all the power of 'zcalc' (because why *wouldn't* it?) However, if it does have gotchas in it (I mean beyond the current subject) I can't say, I just presume it does what it advertises itself to do, and my experiments with it bare that out-- and that's 'calculation' as I use the word. But don't take my pseudo manual as anything more than a comment please it's just what I wish was the case.