Newsgroups: comp.lang.c++,comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!godot.cc.duq.edu!newsfeed.pitt.edu!uunet!in1.uu.net!mole-end!mat
From: mat@mole-end.matawan.nj.us
Subject: Re: Smalltalk @ Operator in C++
Message-ID: <1995Mar23.061447.21690@mole-end.matawan.nj.us>
Organization: :
References: <3k7rdd$drs@News1.mcs.com> <milodD5KGus.sp@netcom.com> <milodD5pFxn.FDK@netcom.com>
Date: Thu, 23 Mar 1995 06:14:47 GMT
Lines: 32
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:119062 comp.lang.smalltalk:22037

In article <milodD5pFxn.FDK@netcom.com>, milod@netcom.com (John DiCamillo) writes:
> jim.fleming@bytes.com (Jim Fleming) writes:
> >In article <milodD5KGus.sp@netcom.com>, milod@netcom.com says...
> >>jim.fleming@bytes.com (Jim Fleming) writes:
> 
> >>>How do I convert Smalltalk programs that heavily use the @ method
> >>>selector to C++?
 ...
     [	p = Point( 1, 20 );	// Or whatever  --mat ]
 ...
> >I guess my original question was not clear. If I have a program
> >that uses *operators* to provide better readability, and I happen
> >to to desire to convert that program to another language that also
> >has "operators" and an extensive set of "operator overloading"
> >features, why would I want to give up my notation?

Because the notation may not be the clearest or the best.

It happens that points have two components in the plane.  What happens
to your operator syntax when you need points in 3-space, or quarternions,
or homogeneous coordinates (which are awfully like quarternions)?

The C++ `value builder' syntax extends to any parameter list from which
an object of that kind can be created.

Using a operator in the Smalltalk way may be an idiom that works well
in Smalltalk, but in C++ we name the things we're building.
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile
 mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
	(Training and consulting in C, C++, UNIX, etc.)
