I was wondering if tainted and constant are just special cases of having general properties on values. If a taint property was set, and the relevant commands checked it, and operators and other built-in functions propagated it, that would be the same thing. Likewise for constant: the relevant primitive (store to an lvalue, other modification primitives) would check it, and other things would propagate it according to the rules required (e.g. a constant container gives constant items when indexed).

So, generalize that idea, and it might be possible to have a richer security model, with attributes tagging individual values rather than globally for the thread.

—John

Replies are listed 'Best First'.
Re: Is Taint just another property?
by Abigail (Deacon) on Jul 04, 2001 at 03:21 UTC
    I do not know what you are trying to get to. First, all values are constants. Values never change, 3 remains 3 (unless you are programming in Fortran). A variable can have a constant property though.

    As for tainting, well, currently Perl already works that way. Data (values) is flagged to be tainted, with the flags being propagated.

    -- Abigail

      By value, I mean lvalues and rvalues, and in the case of Perl, the SV node thing not necessarily bound to any symbol. You must have a background in Functional Programming, where values never change--they are replaced by a whole new value.

        By value, I mean lvalues and rvalues

        That does not make any sense. lvalue and rvalue are contexts, how do you want to tag them with properties? A variable can be used as an rvalue in one statement, and as lvalue in the next.

        You must have a background in Functional Programming, where values never change

        Values don't change in Perl either. If you do think values change, please give a code example. Functional Programming doesn't have side effects, hence no variables changing value.

        -- Abigail

Re: Is Taint just another property?
by MeowChow (Vicar) on Jul 04, 2001 at 10:45 UTC
    Are you referring to something like this? It's experimental now, but attributes will figure quite heavily in Perl 6.
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
      Yes. is constant is an attribute in Perl 6, and I'm wondering how many things attributes could subsume (not that Perl 6 will necessarily implement them that way). Tainting and the (currently inaccessible) byte/char orientation of a string come to mind.

      —John