[Oc-pm] spaces in perl6

Ramana V Mokkapati mvr707 at gmail.com
Tue Oct 31 17:40:14 PDT 2017


syntactical significance of whitespace is probably related to ability to
override reserved words; typically higher order scripting languages allow
this - more to simulate natural languages where context determines the
meaning (and the ensuing ambiguity gives rise to beautiful poetry too).

E.g. if we don't permit "if" to be a subroutine, "if(a>b)" is ok, but if we
allow subroutine name by name "if", we do need to set them apart.

Probably the need to allow override of reserved words is related to number
of reserved words - larger set of reserved words drives the need to
override, again, akin to natural languages. In these cases punctuation is
very critical, but that does not make the language less useful, in fact, it
makes it more colorful.

E.g.

An English professor wrote on the board: A woman without her man is
nothing. The class was then asked to punctuate the sentence.
The men wrote: "A woman, without her man, is nothing."
The women wrote: "A woman: without her, man is nothing."

:-)

On Tue, Oct 31, 2017 at 3:33 PM, Erick Jordan <erickfjordan at gmail.com>
wrote:

> I found this explanation on the perl6 website:
>
> https://docs.perl6.org/language/5to6-nutshell#Whitespace
>
>
>
> On Tue, Oct 31, 2017 at 11:51 AM Bob Mathews <bobmath11 at icloud.com> wrote:
>
>> On Oct 31, 2017, at 11:43 AM, Ramana V Mokkapati <mvr707 at gmail.com>
>> wrote:
>> I did not see any inconsistency ...
>>
>>
>> It seems to be consistently stupid. This bites other postfix operators as
>> well. Take the example at the end of chapter 4.
>>
>> sub postfix:<Factorial>($n) {
>>    [*] 1..$n
>> }
>> say 5Factorial; # 120
>>
>> You can't put a space between 5 and Factorial. (You can put a backslash
>> and then a space, if you want.)
>>
>> The part that amuses me is that this is prefaced by the statement:
>>
>> There is no intention in Perl 6 design to make user-defined operators
>> cryptic.
>>
>>
>>  -bob
>>
>> _______________________________________________
>> Oc-pm mailing list
>> Oc-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/oc-pm
>>
>
> _______________________________________________
> Oc-pm mailing list
> Oc-pm at pm.org
> http://mail.pm.org/mailman/listinfo/oc-pm
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/oc-pm/attachments/20171031/0fe5ab9e/attachment.html>


More information about the Oc-pm mailing list