Re: [sv-bc] applying '{default:} struct assignment pattern on array of structs

From: Jonathan Bromley <jonathanbromley@ymail.com>
Date: Mon Jan 24 2011 - 12:04:20 PST

On 24/01/2011 17:33, Greg Jaxon wrote:
> Does it make sense for |default: '{...}| to distribute the nested
> assignment pattern to each top level field or
> N-1 dimensional subarray of the LHS's data type? That rule would match
> Jonathon's intuition here, but would require
> a default clause for each dimension:
>
> |*module* test;|
> |*struct* { int a; int b; } str[2:0][4];|
> |*assign* str = '{*default*:'{*default*:'{a:1, b:2}}};|
> |*endmodule*|
>

With respect, not my intuition but my suspicions about others'
intuitions. I have learnt from repeated experience that it doesn't pay
to guess about the behaviour of assignment patterns, and try not to
trust my intuition.

It's so easy to get around this by typedef-ing the element type that I
can't get too steamed up about it, but I have on several occasions
observed that it would be quite handy to have a version of "default:"
that is applicable only to the outermost dimension of unpacked array
targets. Something like "default[]:" or "[*]:" maybe.

Plenty other more important things to worry about for now, though.

Jonathan Bromley

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Jan 24 12:04:46 2011

This archive was generated by hypermail 2.1.8 : Mon Jan 24 2011 - 12:04:59 PST