[Omake] SVN Commit: OMake Build System [0.9.8.x] (Rev. 11352)

Jason Hickey jyh at cs.caltech.edu
Thu Jul 19 14:51:07 PDT 2007


On Jul 19, 2007, at 2:23 PM, Aleksey Nogin wrote:
> Note that the following does, of course, update properly:
>    map. =
>       extends $(Map)
>       $|key| = old
>    update(key, val) =
>       map = $(map.add $(key), new)
>       export map
>    update(key, new)
>
> Why should foreach be any different?

Proper methods that export also redefine the head variable in the  
method path.

    foo. =
        i = 0
        incr() =
            i = $(add $i, 1)
            export

    foo.incr()
    foo.incr()
    # foo.i = 2

If foo did not get redefined, the export would have no effect.

It doesn't happen for "update" because it isn't a proper method (a  
method of another object than the current one).

We get the conflict when the head variable is the same as a  
definition in the body.

   foo. =
      boo() =
         foo = 1
         export

   foo.boo()
   # What is foo?

Does that make more sense?

Jason

--
Jason Hickey                  http://www.cs.caltech.edu/~jyh
Caltech Computer Science      Tel: 626-395-6568 FAX: 626-792-4257





More information about the OMake-Devel mailing list