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?]


Michael Vanier <mvanier@bbb.caltech.edu> wrote:
> Another nit I've often had with lisp-like languages is the fact that long
> algebraic expressions often look really clumsy in prefix form 
(especially
> with non-commutative operators like -, <, >, etc.); this is probably just
> because I haven't used scheme enough to get used to it.  It would be cool
> to have a read-macro that translated infix to prefix e.g.
> 
>     #{ a**2 + b**4 / c[i] }  ;; e.g.
> 
> becomes:
> 
> 	(/ (+ (pow a 2) (pow b 4))
> 	   (vector-ref c i))
> 
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.

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

At first it's a little hard to deal with all the parenthesis; at the end,
however, it is very easy to use them. Maybe you should try drscheme or other
gui to help with the parenthesis...

(define [hello-world] (display "hello world"))

That won't be possible if we accepted the []'s as someone stated some days
before.

Also, if we have a vec[i] maybe then we will move for (define-int var) or
(define-char* str), and instead of f(f(f(x))) we will use a for statement.


Ariel


(define (ariel)
 (list 
  ("Ariel Rios Osorio")                           
  ("jarios@linux.cem.itesm.mx")
  ("jarios@usa.net")   
  ("<05> 5 77 55 09"))   
>(ariel)                   

____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1

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