Array as hash tables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas 'PointedEars' Lahn

    #31
    Re: Array as hash tables

    Lasse Reichstein Nielsen wrote:
    [color=blue]
    > Thomas 'PointedEars' Lahn <PointedEars@we b.de> writes:[color=green]
    >> I meant that you do not check if there is a prototype
    >> property (yet) before over*writing*/overlaying it.[/color]
    >
    > Correct. It shouldn't matter, though.[/color]

    Hmmm.
    [color=blue][color=green]
    >> Hmmm. If you overlay `prototype', you would destroy
    >> (the possibility of) inheritance, would you not?[/color]
    >
    > No. The "prototype" property is only relevant on function objects, and
    > the map object ("this.map") is just a normal object. [...][/color]

    Of course (oh my, it is really *hot* weather here!!1 :-)).
    I meant `constructor' (and the like). Can you think of
    overlaying one of them to interfere with normal operation
    (toString() aside, which is obvious)?
    [color=blue][color=green]
    >> ACK, but I would refrain from overlaying prototype properties anyway
    >> here.[/color]
    >
    > Out of curiosity: Why?[/color]

    AFAIS it makes the implementation less flexible and thus restricts
    the freedom of the users to apply it to their needs, effectively
    making it less attractive to them.


    PointedEars

    Comment

    • Lasse Reichstein Nielsen

      #32
      Re: Array as hash tables

      Thomas 'PointedEars' Lahn <PointedEars@we b.de> writes:
      [color=blue]
      > I meant `constructor' (and the like). Can you think of
      > overlaying one of them to interfere with normal operation
      > (toString() aside, which is obvious)?[/color]

      No. There isn't really any "normal operation" for an instance of
      Object. The "constructo r" property is only a convenience, it is never
      used for anything by the language. The functions like "hasOwnProperty "
      are also only used by the programmer. The language sematics uses
      [[hasProperty]] directly, so overwriting "hasOwnProperty " will not
      affect anything except specific user-introduced calls to that.
      [color=blue]
      > AFAIS it makes the implementation less flexible and thus restricts
      > the freedom of the users to apply it to their needs, effectively
      > making it less attractive to them.[/color]

      I don't see any restriction in this case, but if there were some,
      it would be a reason.

      /L
      --
      Lasse Reichstein Nielsen - lrn@hotpop.com
      DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
      'Faith without judgement merely degrades the spirit divine.'

      Comment

      Working...