[Prev][Next][Index][Thread]

Re: C# is not Dylan (was: Re: C# : The new language from M$)



In article <m2u2ebzfyf.fsf@gododdin.internal.jasmine.org.uk>, Simon 
Brooke <simon@jasmine.org.uk> wrote:

> Bruce Hoult <bruce@hoult.org> writes:
> 
> > In article <kpamlscdjl89ihfhsdk3d4rinoa1hji78j@4ax.com>, Jason Trenouth 
> > <jason@harlequin.com> wrote:
> > 
> > > Well, Dylan really isn't C-ish syntax. No braces (except in macro 
> > > definitions), no casting, postfix type declarations, and very
> > > different (Lisp/Scheme-like) identifier conventions. Unfortunately,
> > > from the point of view of promulgating the language, Dylan's syntax
> > > looks very alien to many C programmers.
> > 
> > I suspect that the guys tasked with coming up with the infix syntax 
> > were 
> > concerned that if it looked *too* C-like then people would expect it to 
> > have C semantics.
> 
> Isn't there also an (alternative) prefix syntax for Dylan? That must
> be even more lisp-like (says Simon, never having tried it).

Oh, absolutely.  A lot of simple Scheme textbook programs can be 
converted into prefix Dylan simply by doing a global s/lambda/method/ 
e.g.

(define fact (lambda (n) (if (< n 1) 1 (* n (fact (- n 1))))))  // Scheme
(define fact (method (n) (if (< n 1) 1 (* n (fact (- n 1))))))  // Dylan

Then the differences start.  Scheme has a shortcut "(define (fact n) ... 
)" whereas Dylan has "(define-method fact (n) ... )".  Dylan lets you 
replace args in the argument list with (n <integer>) as a type 
declaration.  Dylan has a built-in object system (and everything is an 
object).  But they are very, very similar.

But neither current implementation of Dylan supports the prefix syntax.  
At all.  It's pining for the Fjords.  It's an ex-syntax.  It's bleedin' 
snuffed it.

-- Bruce



References: