Finiteness of object properties set
David Bruant
david.bruant at labri.fr
Wed Sep 7 06:41:14 PDT 2011
Le 07/09/2011 15:29, Lasse Reichstein a écrit :
>
>
> On Wed, Sep 7, 2011 at 2:07 PM, David Bruant <david.bruant at labri.fr
> <mailto:david.bruant at labri.fr>> wrote:
>
> If this is really considered, the problem to solve is to express
> an infinite set with a finite representation. RegExps may be a
> solution. One big question is on RegExp expressivity: Can any
> infinite string set be expressed with (a finite number of) JS
> RegExps?
>
>
> Nope. Any finite set of RegExps can be combined into a single RegExp,
> so the language they recognize is still regular (or what the class of
> languages recognized by JS RegExps really is, since it's bigger than
> the regular languages, but doesn't include all context free langauges).
Very true. I had a doubt on whether RegExp were purely limited to
regular languages. I have never really taken the time to check whether
RegExps were just providing sugar for regular languages matching or if
they were going further than that. But hopefully, you're right.
> As for proxies with arbitrarily many properties, I don't think there's
> a way to prevent it (it's the catch-all effect).
Extensible proxies are not a problem. Non-extensible proxies are if the
specs asks for non-extensible objects (then proxies) to have a finite
set of properties. Current design and prototype implementation [1] seem
to go in the direction of non-extensible proxies having a finite set of
properties even though still "catching all". See L.262-273 where is
defined this.fixedProps which is a regular object (finite number of
properties).
David
[1]
http://code.google.com/p/es-lab/source/browse/trunk/src/proxies/FixedTrappingProxy.js
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110907/4eadaeef/attachment-0001.html>
More information about the es-discuss
mailing list