From: Xiangyu Yang Date: 2004-07-16T15:52:15+09:00 Subject: Re: Do you want ":=" operator? You may wonder why I focus on program appearance so much. The key point is productivity. I use script languages to speed my work. At the same time I'm a project leader and want my members can all improve their works. I had found someone access serial port by several hundred lines in C++, while it costs only 3 or 4 lines in Tcl; and another one spend half a day to write a hex2bin, while it's so easy in ruby. But it's hard to force everyone to study Tcl or Ruby in deep. And normally they only use very limited part of the features. I don't want to teach ruby in ordor to use my cpu simulation environment. If the users can type code just as pseudo-code of the algorithm and even don't know they are actually programming in Ruby, it's the success of my design, and also the language's. Phil Tomson wrote: > In article , > Xiangyu Yang wrote: > >>Right. But not all object states or values can be changed that way, > >>and there is no meaningful default operation for such a behaviour. > >>Thus, it makes more sense to use the appropriate #<< or #assign > >>mechanism. > > > >>-austin > >>-- > >>Austin Ziegler * halxsxtaxuxx@gxxxxxxlx.cox > >>* Alternate: ausxin@hxaloxxtxxxuex.xa > > > >I can't use << and other operators, for they are all meaningful in my > >CPU model and have precedence problem. > > yes, usually these operators ('<<' and '>>' ) are used for shifting or > rotating registers in hardware descriptions. You can always define an > 'sl' or 'shift_left' method for your classes I suppose, but '<<' and '>>' > are widely understood especially among Verilog programmers. > > >And I can't force anybody to > >program "R0.assign(R0&R1)" for my CPU, otherwise I will be kicked to > >death. > > Yeah, hardware designers are a tough crowd ;-) > > >I have to translate "Rx=..." to "Rx.assign ...", then eval the > >latter. > > Wow, you're really serious about this ;-) > > >The ":=" need not be supported by all classes. To use it or not, it's > >the programmer's choice. > > Quite true. > > Phil