OEP

140

Title

Operator for moving references

Summary

Separate the action of moving mobiles into a new operator.

Owner

Adam Sampson <ats@offog.org>

Status

Proposed

Date-Proposed

2006-03-14

Keywords

language mobiles operators honeysuckle

In the Honeysuckle language, all variables are effectively occam-pi MOBILEs; this makes it necessary to differentiate between copying the value of a variable and moving the contents of a variable. Doing the equivalent in occam-pi is somewhat awkward at the moment, since the := operator is used for both operations. It might be better to introduce an explicit operator for moving a variable's contents:

MOBILE INT a, b:
SEQ
  a := 3
  -- a -> 3, b -> undefined
  b <- a
  -- a -> undefined, b -> 3
  a := b
  -- a -> 3, b -> 3

The situation is simpler for channel communications, since whether to copy or move a value can be inferred from the channel's type. (As everything is mobile in Honeysuckle, it also has different operators for copying and moving values along channels.)

OEP/140 (last edited 2007-09-27 01:06:08 by ats1)