unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* iterating over (nonascii) chars
@ 2013-10-11 14:07 Rustom Mody
  2013-10-14 20:48 ` Michael Heerdegen
       [not found] ` <mailman.3994.1381783767.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Rustom Mody @ 2013-10-11 14:07 UTC (permalink / raw)
  To: help-gnu-emacs

In perl-mode.el I find things like


    (modify-syntax-entry ?* "." st)
    (modify-syntax-entry ?+ "." st)
    (modify-syntax-entry ?- "." st)
    (modify-syntax-entry ?/ "." st)
    (modify-syntax-entry ?< "." st)
    (modify-syntax-entry ?= "." st)
    (modify-syntax-entry ?> "." st)


Any reason why its not written as follows?

(dolist (v (string-to-list "*+-/<=>")) 
 (modify-syntax-entry v "." st))


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: iterating over (nonascii) chars
  2013-10-11 14:07 iterating over (nonascii) chars Rustom Mody
@ 2013-10-14 20:48 ` Michael Heerdegen
       [not found] ` <mailman.3994.1381783767.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Heerdegen @ 2013-10-14 20:48 UTC (permalink / raw)
  To: help-gnu-emacs

Rustom Mody <rustompmody@gmail.com> writes:

> In perl-mode.el I find things like
>
>
>     (modify-syntax-entry ?* "." st)
>     (modify-syntax-entry ?+ "." st)
>     (modify-syntax-entry ?- "." st)
>     (modify-syntax-entry ?/ "." st)
>     (modify-syntax-entry ?< "." st)
>     (modify-syntax-entry ?= "." st)
>     (modify-syntax-entry ?> "." st)
>
>
> Any reason why its not written as follows?
>
> (dolist (v (string-to-list "*+-/<=>")) 
>  (modify-syntax-entry v "." st))

Probably, no.  Many people prefer the first version wrt readability.
While galloping through the code the first version is easier to parse
for your eyes, while the second version is shorter, of course.  Use
whatever suits your style of thinking and coding.


Regards,

Michael.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: iterating over (nonascii) chars
       [not found] ` <mailman.3994.1381783767.10748.help-gnu-emacs@gnu.org>
@ 2013-10-15  3:29   ` Rustom Mody
  0 siblings, 0 replies; 3+ messages in thread
From: Rustom Mody @ 2013-10-15  3:29 UTC (permalink / raw)
  To: help-gnu-emacs

On Tuesday, October 15, 2013 2:18:55 AM UTC+5:30, Michael Heerdegen wrote:
> Rustom Mody writes:
> 
> 
> > In perl-mode.el I find things like
> >
> >     (modify-syntax-entry ?* "." st)
> >     (modify-syntax-entry ?+ "." st)
> >     (modify-syntax-entry ?- "." st)
> >     (modify-syntax-entry ?/ "." st)
> >     (modify-syntax-entry ?< "." st)
> >     (modify-syntax-entry ?= "." st)
> >     (modify-syntax-entry ?> "." st)
> > 
> > Any reason why its not written as follows?
> >
> > (dolist (v (string-to-list "*+-/<=>")) 
> >  (modify-syntax-entry v "." st))
> 
> Probably, no.  Many people prefer the first version wrt readability.
> While galloping through the code the first version is easier to parse
> for your eyes, while the second version is shorter, of course.  Use
> whatever suits your style of thinking and coding.

Hell I thought there is some superman kryptonite answer involving text-properties/unicode/uni-vs-multibyte or some such arcanity that I cant wrap my brain round :-)

I am still not so sure...


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-15  3:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-11 14:07 iterating over (nonascii) chars Rustom Mody
2013-10-14 20:48 ` Michael Heerdegen
     [not found] ` <mailman.3994.1381783767.10748.help-gnu-emacs@gnu.org>
2013-10-15  3:29   ` Rustom Mody

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).