From: ptkwt@... (Phil Tomson) Date: 2004-07-16T13:37:16+09:00 Subject: Re: Do you want a ":=" operator? In article , Xiangyu Yang wrote: > >gabriele renzi wrote: >> >> If you're working with hardware check out >> http://www.aracnet.com/~ptkwt/ruby_stuff/RHDL/ >> >> Ruby Hardware Description Language :) > >An interest thing. > >In your RHDL you have to use .assign or .<< to do signal assignment, >annoying thing also in my code for HW CPU model. Yes, it's annoying. I wish we had a := op. > >In ruby, the "=" will assign other *object* to a *variable*, and can't >(and shouldn't) be overrided. There are no simple way to modify the >state of an *object* referenced by a *variable*. Using .assign or >overriding other operators to do this job are both ugly. I notice that >someone suggested ":=" operator which can be overrided. I dream of it >all the days :). If I have ":=", I'm sure that my CPU model will save >at least half of the current lines and the program will be much more >natural and clearer. I suggested it a while back for this very reason. BTW: I missed the parent to this post. Are you using RHDL? I'm the author, so I would be interested in finding out if anyone is using it. And if you are using it do you have any suggestions for changes. I'm considering doing another release one of these days. > >In short, when you use ruby to model some objects, the ability to >assign/modify the *object* state/value in simple expression way is very >useful. It provides the possibility of running ruby code *directly* to >model other worlds. > Well, it would make it easier anyway. phil