POV-Ray : Newsgroups : povray.off-topic : I'm in the mood for monads : Re: Living in a box Server Time
29 Jul 2024 10:31:16 EDT (-0400)
  Re: Living in a box  
From: Le Forgeron
Date: 21 Apr 2012 17:53:13
Message: <4f932c49$1@news.povray.org>
Le 21/04/2012 23:37, Orchid Win7 v1 nous fit lire :
> "override operator;".

are you sure you do not want "operator," instead ?
For once, I'm glad C++ does not allow such!

The overloading (?) of << and >> is already enough trauma when dealing
with streams... or not.

c = ceo << eke ;
d = kaz << ekk ;

one is a shift operation, the other is write in a stream... can you say
which one ? (and either c is an integer or a stream...)

in fact, monade seems to be the << with polymorphic type added.

(for streams, << returns a reference to updated stream (sort of), so
  cout << "hello " << "world" << endl;
is in fact ((cout << "hello") << "world ) << endl;


Now, if << is specified to return not the same reference type as the one
on the left, it can become "interesting".

But of course, then, we need a template to declare the << for the part
on right... or a lot of overloading.

I wonder if there is a deep difference between haskell & forth... or a
bit of lisp. Just that haskell dropped all ()...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.