[m-dev.] a conditional field update operator

Michael Day mikeday at yeslogic.com
Wed Mar 8 14:45:53 AEDT 2017


Hi Zoltan,

> In many cases, the second approach is appropriate, but at the moment,
> it takes five lines of code instead of one. I was thinking that we could
> have a new operator, maybe ::= or :?=, that would be like :=, but
> would create a new structure only if the new value of the field was
> different from the old value. Then the compiler would expand the one line
> to the five lines version internally.

I would be tempted to just make := always do the pointer equality test 
and omit it if it's obviously going to fail, eg. if the right-hand side 
is a newly constructed cell that can't possibly be equal.

Michael

-- 
Prince: Print with CSS!
http://www.princexml.com


More information about the developers mailing list