Phil Tomson schrieb:
> 
> Here's what I finally came up with:
> 
>   class AndGate < RHDL
>     inputs :a, :b
>     outputs :out
>     init {
>       somevar = 0
>       define_behavior {
>         out << (a & b)
>         puts "somevar is: #{somevar}"
>         somevar +=1
>       }
>     }
>   end

This is a nice looking compromise.

> BTW: I'm thinking of using '<=' for assignment instead of '<<' since '<=' has 
> lower precedence than '<<' and that would allow:
>   out <= a & b  #parens not required

I think you know this already, but if you would use the same assignment 
operator for variables, you could omit the init method.

Regards,
Pit