> -----Original Message-----
> From: Pier Bover <pierbove...@gmail.com>
> Sent: Monday, March 19, 2018 5:06 PM
> To: Isiah Meadows <isiahmead...@gmail.com>
> Cc: Ron Buckton <ron.buck...@microsoft.com>; es-discuss <es-
> disc...@mozilla.org>
> Subject: Re: Pointers
> 
> So the proposal is basically having references to primitives like strings, 
> bools,
> etc?

If you are talking about my proposal, then no. References wouldn't be limited 
to primitives, for example:

```js
function tryGet(map, key, ref value) {
  if (map.has(key)) {
    value = map.get(key);
    return true;
  }
  value = undefined;
  return false;
}

const map = new Map();
map.set("a", { x: 1 });
let value;
console.log(tryGet(map, "a", ref value), value); // true { x: 1 }
console.log(tryGet(map, "b", ref value), value); // false undefined
```

Ron
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to