[implementations-list] [OT] Language logic and syntax

Štěpán Němec stepnem at gmail.com
Mon May 10 19:44:13 CEST 2010


On Mon, May 10, 2010 at 12:21:39PM +0000, Vegard Øye wrote:
> > The very example of the error you made shows how unhelpful going
> > against one's thinking while writing in a language is.
> 
> Granted. I guess I started doing it this way when converting a bunch of
> `case' forms to `cond' forms (since `case' is not available in plain
> Elisp), e.g.,
> 
>     (case variable          (cond
>       ('foo                  ((eq 'foo variable)
>        (wibble))              (wibble))
>       ('bar           =>     ((eq 'bar variable)
>        (wobble))              (wobble))
>       (t                     (t
>        (flob)))               (flob)))
> 
> The repeated "variable" is just line noise in this example, hence I
> put it last.

No; it's just the same as with other examples -- `variable' has a
meaning, and I would put it first (the redundancy is irritating, but
I don't see how inverting the argument order improves that).

[Line noise are the quotes in the `case' form, BTW.]

> Apparently, "Yoda conditions" are rather unpopular in infix languages.
> Maybe they should be avoided in prefix languages as well.

No idea about either of those statements. From my very limited
code-reading experience, the first one might be true.

As for the second one, "makes sense" is more important for me than
"everybody does it", although it might make sense to obey certain
conventions, esp. when collaborating with others. Fortunately,
conventions generally tend to make sense -- in code writing, that is;
certainly not in a lot of other areas of human activity.

Štěpán
> 
> Vegard 		 	   		  
> _________________________________________________________________
> Få nye Windows Live™ Messenger.
> http://download.live.com/messenger



More information about the implementations-list mailing list