From: Pascal Bourguignon
Subject: Re: A Semicolon-Syntax
Date: 
Message-ID: <87u0drf1zv.fsf@thalassa.informatimago.com>
···@zedat.fu-berlin.de (Stefan Ram) writes:

>   I am experimenting with an S-expression-like syntax, which
>   uses "<>" instead of "()".
> [...]
> < a b c d; e f g; h i >
>
>   means
>
> << a b c d >< e f g >< h i >>
>
>   (The rest after the final ";" is also considered a sublist.)
>
>   I just wonder if anyone else considers such a notation more
>   readable and if something like this already has been
>   considered or been introduced in Lisp.
>
>   Possibly this could be extended to "," so that:
>
> < a b; c d, e f >
>
>   means
>
> < < a b >< < c d >< e f >>>

This is very nice.  But how will you handle ((((a b) (c d))(e f))(g h))?
Will you introduce half commas, subscript commas, and 20 other separators?

It's not more readable, it's harder to read, because you have to
remember the precedence levels of the 20 different characters.

But in any case, do write it, it's a good exercice, and it change us
from the usual recursion questions. :-)

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
You're always typing.
Well, let's see you ignore my
sitting on your hands.

From: Ulrich Hobelmann
Subject: Re: A Semicolon-Syntax
Date: 
Message-ID: <3vdf56F15256bU1@individual.net>
Stefan Ram wrote:
> Pascal Bourguignon <····@mouse-potato.com> writes:
>> This is very nice.  But how will you handle ((((a b) (c d))(e f))(g h))?
> 
>   It can always be written without the semicolon as
> 
> <<<< a b >< c d >>< e f >>< g h >>

Actually this whole replacing-parens-with-punctuation reminds me of the 
Lambda Calculus, where IIRC the dot is also introduced to put parens 
around its two sides, like this:
lambda foo . bla-blub ~=
(lambda foo) (bla-blub) or something like that.  A colon (double-dot) 
would do the same, but parenthesize even the level with dots on it.

But here we can see that you'd need lots of punctuation to avoid all ()s.

>   I think for many applications two levels ("," and ";") already
>   are helpful. For my own applications often only one level is
>   needed. Eventually, one will still have to use some
>   parentheses.

Ok.

>> Will you introduce half commas, subscript commas, and 20 other
>> separators?
> 
>   I am just implementing one level (";") and possibly will 
>   add a second level (",") and a special case (".") later.
> 
>> It's not more readable, it's harder to read, because you have to
>> remember the precedence levels of the 20 different characters.
>> But in any case, do write it, it's a good exercice, and it change us
>>from the usual recursion questions. :-)
> 
>   OK.

I agree there.  To me it seems to create more problems than it solves.

-- 
Majority, n.: That quality that distinguishes a crime from a law.
From: Coby Beck
Subject: Re: A Semicolon-Syntax
Date: 
Message-ID: <bolkf.232655$ir4.191300@edtnps90>
"Ulrich Hobelmann" <···········@web.de> wrote in message 
····················@individual.net...
> Stefan Ram wrote:
>> Pascal Bourguignon <····@mouse-potato.com> writes:
>>> This is very nice.  But how will you handle ((((a b) (c d))(e f))(g h))?
>>
>>   It can always be written without the semicolon as
>>
>> <<<< a b >< c d >>< e f >>< g h >>
>
> Actually this whole replacing-parens-with-punctuation reminds me of the 
> Lambda Calculus, where IIRC the dot is also introduced to put parens 
> around its two sides, like this:
> lambda foo . bla-blub ~=
> (lambda foo) (bla-blub) or something like that.  A colon (double-dot) 
> would do the same, but parenthesize even the level with dots on it.
>
> But here we can see that you'd need lots of punctuation to avoid all ()s.
>
>>   I think for many applications two levels ("," and ";") already
>>   are helpful. For my own applications often only one level is
>>   needed. Eventually, one will still have to use some
>>   parentheses.
>
> Ok.
>
>>> Will you introduce half commas, subscript commas, and 20 other
>>> separators?
>>
>>   I am just implementing one level (";") and possibly will add a second 
>> level (",") and a special case (".") later.
>>
>>> It's not more readable, it's harder to read, because you have to
>>> remember the precedence levels of the 20 different characters.
>>> But in any case, do write it, it's a good exercice, and it change us
>>>from the usual recursion questions. :-)
>>
>>   OK.
>
> I agree there.  To me it seems to create more problems than it solves.

I admit I have not read every post in this thread very carefully, but it has 
never been clear to me just what problem this does solve.

-- 
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")
From: Andras Simon
Subject: Re: A Semicolon-Syntax
Date: 
Message-ID: <vcdvey6j5cu.fsf@csusza.math.bme.hu>
"Coby Beck" <·····@mercury.bc.ca> writes:

> "Ulrich Hobelmann" <···········@web.de> wrote in message 
> ····················@individual.net...
> > Stefan Ram wrote:
> >> Pascal Bourguignon <····@mouse-potato.com> writes:
> >>> This is very nice.  But how will you handle ((((a b) (c d))(e f))(g h))?
> >>
> >>   It can always be written without the semicolon as
> >>
> >> <<<< a b >< c d >>< e f >>< g h >>
> >
> > Actually this whole replacing-parens-with-punctuation reminds me of the 
> > Lambda Calculus, where IIRC the dot is also introduced to put parens 
> > around its two sides, like this:
> > lambda foo . bla-blub ~=
> > (lambda foo) (bla-blub) or something like that.  A colon (double-dot) 
> > would do the same, but parenthesize even the level with dots on it.
> >
> > But here we can see that you'd need lots of punctuation to avoid all ()s.
> >
> >>   I think for many applications two levels ("," and ";") already
> >>   are helpful. For my own applications often only one level is
> >>   needed. Eventually, one will still have to use some
> >>   parentheses.
> >
> > Ok.
> >
> >>> Will you introduce half commas, subscript commas, and 20 other
> >>> separators?
> >>
> >>   I am just implementing one level (";") and possibly will add a second 
> >> level (",") and a special case (".") later.
> >>
> >>> It's not more readable, it's harder to read, because you have to
> >>> remember the precedence levels of the 20 different characters.
> >>> But in any case, do write it, it's a good exercice, and it change us
> >>>from the usual recursion questions. :-)
> >>
> >>   OK.
> >
> > I agree there.  To me it seems to create more problems than it solves.
> 
> I admit I have not read every post in this thread very carefully, but it has 
> never been clear to me just what problem this does solve.

The problem of having too much free time. 

Andras
From: Coby Beck
Subject: Re: A Semicolon-Syntax
Date: 
Message-ID: <Qjpkf.136895$S4.15073@edtnps84>
"Andras Simon" <······@math.bme.hu> wrote in message 
····················@csusza.math.bme.hu...
> "Coby Beck" <·····@mercury.bc.ca> writes:

>> I admit I have not read every post in this thread very carefully, but it 
>> has
>> never been clear to me just what problem this does solve.
>
> The problem of having too much free time.

LOL!  I long for the day that was a problem...carry on ;)

-- 
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")
From: Wade Humeniuk
Subject: Re: A Semicolon-Syntax
Date: 
Message-ID: <d1mkf.232660$ir4.25386@edtnps90>
Pascal Bourguignon wrote:

> 
> This is very nice.  But how will you handle ((((a b) (c d))(e f))(g h))?
> Will you introduce half commas, subscript commas, and 20 other separators?
> 
> It's not more readable, it's harder to read, because you have to
> remember the precedence levels of the 20 different characters.
> 
> But in any case, do write it, it's a good exercice, and it change us
> from the usual recursion questions. :-)
> 

Here is an alternative.  :) (Me being Stupid)

 > - Means push level
< - Means pop level
< + <newline> - Pop all levels
. - Means same level, new expression


(setq a b)
(setq c d)

=>

 > setq a b <
 > setq c d <

((a b c d) (e f g) (h i))

=>

 > a b c d . e f g . h i <

((((a b) (c d))(e f))(g h))

=>

 >> >> a b . c d << . e f < . g h <

(defun fact (n)
   (if (< n 2) 1
     (* n (fact (1- n)))))

=>

 > defun fact > n <
   > if > lt n 2 < 1
     > * n > fact > 1- n
<

or


 > defun fact >n<
    > if . lt n 2 . 1
       > * n . fact > 1- n
<