Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2003-08-15 15:16:13


On Fri, Aug 15, 2003 at 02:44:20PM -0400, Joel Young wrote:
> From: Brian McNamara <lorgon_at_[hidden]>
> > to think deeply about it though; it is unclear to me if the FC++
> > implicit assumption of 'value semantics' (FC++ doesn't allow (mutable)
> > reference parameters) will throw a wrench in the works. It is also
>
> I tried using FC++ a while ago for flexibly expressing and passing
> around linear algebra pipelines and I found this lack of mutable
> reference parameters to be highly constraining and insanely frustrating.
> I wanted to be able to take a reference to a vector as a parameter and
> return that same vector, mutated, as a return value. I started to hack
> FC++ to remove the const on the references but after a bit gave up.

Yes... square peg, round hole. (You can use pointers, but this
sometimes turns existing code into mess of "&"s, "*"s, and
"compose(dereference)"s.)

An open question (which someone on the list suggested) is whether
monads will provide a convenient interface to bring mutation cleanly
back into the mix. That's what happens, e.g., in Haskell. But the
monad stuff in FC++ is really new (and monads are still pretty new to
me), so it isn't yet clear if/how this may address the issue.

-- 
-Brian McNamara (lorgon_at_[hidden])

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk