This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Re: Bracket heresies. What about subscripting?]


> >     #{ a**2 + b**4 / c[i] }  ;; e.g.
> > 
> > becomes:
> > 
> > 	(/ (+ (pow a 2) (pow b 4))
> > 	   (vector-ref c i))

By the way, by my understanding of common precedence laws the above expressions
are completely different.

> Nevertheless, for me it is clearer the "clumsy" parenthesis than the text you
> wrotte. The problem is that non lispers intend to do things as they are done
> in C. If you want to program in Scheme you need to know Scheme.
> The grammar is very easy and very clear to understand. 
> This debate about using [] in the same way as parenthesis and vec[i]
> instead of (vector-ref vec i) is akin to asking the greek to start using latin
> alphabet because we can not understand the greek alphabet.

Except that the language of mathematics is now universally entrenched right
around the globe (even the Chinese now use arabic numbering, mostly) and the
most common method of writing algebraic expressions is with infix operators
(or better yet, with no operators at all). This was the premise behind all
the Algol derivatives and its still a major influence on the way most
computer languages work. I would agree that prefix notation is excellent
for representing the way the computer stores the expression but not intuitive
for most people. Scheme algebra is easy to learn but takes a long time to
``deeply learn'' where you can manipulate it like normal algebra (think of the
years students spend practicing manipulation of infix expressions in school).

> Instead of trying to "help" people giving quick solutions we may better teach
> them how to programme Scheme.

No, give them a front-end of their choice and leave the scheme alone.

> (define [hello-world] (display "hello world"))
> 
> That won't be possible if we accepted the []'s as someone stated some days
> before.

What should it do? Under guile at the moment it prints some words and
sticks a special meta-value into a strange named variable. I won't be crying
if I lose the ability to do such things.

Since R5RS reserves the [] chars, the current behaviour is wrong anyhow
(it should report a parse error on an attempt to use reserved chars).

	- Tel

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]