equivariant functions

Bill Baxter wbaxter at gmail.com
Wed Oct 15 12:53:03 PDT 2008


On Thu, Oct 16, 2008 at 4:39 AM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> Bill Baxter wrote:
>>
>> On Thu, Oct 16, 2008 at 4:10 AM, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>>
>>> Bill Baxter wrote:
>>>>
>>>> Hmmm, looking at this:
>>>>
>>>> class Owner
>>>> {
>>>>  const?(A) a() const?{...}
>>>>  const?(B) b() const?{...}
>>>>  const?(C) c() const?{...}
>>>>  const?(D) d() const?{...}
>>>>  const?(E) e() const?{...}
>>>>  const?(F) f() const?{...}
>>>>  const?(G) g() const?{...}
>>>>  const?(H) h() const?{...}
>>>>  const?(I) i() const?{...}
>>>>  const?(J) j() const?{...}
>>>> }
>>>>
>>>> makes me think if we go with that syntax, Andrei is sooner or later
>>>> going to complain about his D code asking him too many questions.  :-)
>>>> Eh, I guess he can edit the emacs mode to display const? as
>>>> smiley-faces or something.  :-) :-)
>>>
>>> At this point Walter will intervene with:
>>>
>>> class Owner
>>> {
>>>  const?
>>>  {
>>>     A  a()  {...}
>>>     B  b()  {...}
>>>     C  c()  {...}
>>>     D  d()  {...}
>>>     E  e()  {...}
>>>     F  f()  {...}
>>>     G  g()  {...}
>>>     H  h()  {...}
>>>     I  i()  {...}
>>>     J  j()  {...}
>>>  }
>>> }
>>>
>>> which isn't half bad.
>>
>> I was thinking about that too.  But I'm not a big fan of blocks that
>> change the meaning of declarations in a non-local way.  It looks quite
>> readable in toy examples, but after you insert all the bodies and
>> documentation comments for everything in the block, it becomes very
>> easy to lose sight of the tag way back at the beginning of the block.
>
> I disagree. A block is a block is a block. Indentation shows it's not
> non-local. I understand how you could formulate an argument against labels.
> They do change meaning in a non-obvious way. Block indentation makes all the
> difference. I'm in fact surprised to hear that from a pythonboi :o).

If the top of the block is off the screen it's not necessarily obvious
that it's a block.
And even if you do realize it's a block, you don't know what special
attributes are in play without scrolling back up to see what it says.
That's why I don't like em.  Not sure what Python has to do with it.
I think a method signature in Python can pretty much always be read
and understood without having to look at some tag that exists further
up the screen.  Closest thing I can think of in Python is the
decorators, but I think those always have to appear right before the
method signature that they modify.

--bb



More information about the Digitalmars-d mailing list