Christian Hoffmann on Tue, 07 May 2013 23:26:14 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: PARI 2.6 syntax 2: [f(x)|x<-a,b(x)] |
Am 11.03.13 10:41, schrieb Andreas Enge:
Delimiting tokens by blank space (including newlines) is serving well in the programming language "R" (see r-project.org). There we have ' <- ' for assignment (not =) and '==' for comparison.On Sun, Mar 10, 2013 at 08:13:14AM +0000, Bernadette.Perrin-Riou@math.u-psud.fr wrote:A naive question. What about [ 1, 2; 3,4] if it is sensible to space ?Normally, a lexical analysis as done for the C or Java languages, for instance, would split this into the 9 one-character tokens [ 1 , 2 ; 3 , 4 ] White space is allowed between tokens, here between ; and 3. And the special characters [ , ; ] are easily recognised as tokens of their own. A number like 12 would be recognised as one token, whereas with a space in between, it would be two tokens 1 and 2. Unless I have overlooked something, the proposed change would only mean you are not allowed any more to have white-space inside numbers, variables and function names or keywords such as "for" (also function names, strictly speaking, I suppose). Andreas
The problem of large constants spanning more than one line could be solved by '\' at the end.
As for backward compatibility, in R a warning is published well in advance for the case of 'deprecated', that is features that will be abolished in some major revision in the future.
Christian -- Christian W. Hoffmann, CH - 8915 Hausen am Albis, Switzerland Rigiblickstrasse 15 b, Tel.+41-44-7640853 c-w.hoffmann@sunrise.ch, christian@echoffmann.ch, www.echoffmann.ch