Language mavens: Is there a programming with "if then else ENDIF" syntax?

Steve Howell showell30 at yahoo.com
Wed Nov 18 20:25:43 EST 2009


On Nov 18, 5:13 pm, Steven D'Aprano
<ste... at REMOVE.THIS.cybersource.com.au> wrote:
> On Wed, 18 Nov 2009 15:58:24 -0800, Steve Howell wrote:
> > On Nov 18, 2:22 pm, Steven D'Aprano
> > <ste... at REMOVE.THIS.cybersource.com.au> wrote:
> >> On Wed, 18 Nov 2009 02:06:49 -0800, Steve Howell wrote:
> >> > P.S. The underscores before the method names might look a little
> >> > funny for inner methods, but it's the nature of the code..._dict and
> >> > _list would lead to confusion with builtins, if not actual conflict.
> [...]
>
> But I'm not sure what naming convention you used. It seems fairly
> arbitrary to me, but whatever it is, it clashes with built-ins, which is
> a good sign that you need a different set of names. Since naming the
> functions with leading underscores also clashes with the convention that
> such functions are private, that's a further sign that you should use a
> different naming convention. At the point that you are apologizing for
> the convention you use, maybe you should rethink it.
>
> But of course it's your code, and you're free to use whatever convention
> you like.
>

The code in question, with the _list and _dict, is used as a part of
mini-compiler-like-thingy that generates code from an expression
syntax.  If you've ever worked with code to implement compilers,
interpreters, VMs, etc., you probably know the naming challenges
involved.  The whole reason I mentioned the wierd names in a "P.S."
was to say that I realized it was a little wierd, and it was kind of
besides the point.  But I have enjoyed your responses.  They are
slightly pedantic, of course, but in a good way!  Makes me think about
the code more...

If you want more context on the code itself (apart from if/elif
discussion and other digressions), I describe it in more detail here:

http://showellonprogramming.blogspot.com/2009/11/more-on-python-deep-copy-schema.html



More information about the Python-list mailing list