[Python-ideas] Operator as first class citizens -- like in scala -- or yet another new operator?
Terry Reedy
tjreedy at udel.edu
Fri May 24 11:44:54 EDT 2019
On 5/24/2019 8:50 AM, Yanghao Hua wrote:
for instance,
> I explained already but here again: you will need to have "this_signal
> <<= (that_signal << 4) + something, and next line you should be able
> to write this_signal <<= 4 bit, where all arithmetic operation still
> have to be kept. Otherwise it makes signal doesn't look like a value
> ... it needs to be looking like a integer but with a different
> assignment behavior. In hardware design domain a signal is just a
> value but with its own assignment behavior involving delta-cycles (a
> virtual time step increase of the value zero ... I know it is a bit
> confusing to SW developers). So the intention is to keep all
> arithmetic ops like a int, but only changing how the assignment is
> done.
What I understand is that you are doing discrete-time hardware
simulation and that you need a operator that will schedule future
assigments to int-like objects. Have you considered using '@' to do
that? int @ int-expression is currently invalid, so defining it will
not interfere with other int operations. What am I not understanding?
--
Terry Jan Reedy
More information about the Python-ideas
mailing list