Hi Gord, So are you saying only 'return;' is allowed, or no return statement is allowed? Please confirm. Regards Surya -------- Original Message -------- Subject: Re:[sv-bc] What type of return stmt allowed in class constructor? From: Gordon Vreugdenhil <gordonv@model.com> To: Surya Pratik Saha <spsaha@cal.interrasystems.com> Cc: sv-ec@eda.org, sv-bc@eda.org Date: Thursday, January 03, 2008 8:46:15 PM > No return value is permitted from the user code -- the return value is > determined by the implementation. > > I agree that it isn't clear from the LRM but that is the way that > things must currently behave. At some point it would be conceivable > to allow C++ style user defined memory allocators and then allow > user-determined return values but we're a long way from having > enough language infrastructure to allow that. > > Gord. > > Surya Pratik Saha wrote: >> Hi, >> As per LRM: >> *The new operation is defined as a function with no return type, and >> like any other function, it must be non-blocking. >> Even though new does not specify a return type, the left-hand side of >> the assignment determines >> the return type.* >> >> It is not clear from the text, which type of return statement is >> allowed. Consider the following cases: >> program class20; >> >> class A; >> bit b; >> reg r; >> >> A a; >> function new(bit i, reg j); >> b = i; >> r = j; >> return a; >> endfunction >> >> endclass >> >> A a; >> >> endprogram >> Is the above case valid. >> Also what will happen if only 'return;' is used? >> >> -- >> Regards >> Surya >> >> >> -- >> This message has been scanned for viruses and >> dangerous content by *MailScanner* <http://www.mailscanner.info/>, >> and is >> believed to be clean. > -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Thu Jan 3 07:38:05 2008
This archive was generated by hypermail 2.1.8 : Thu Jan 03 2008 - 07:38:20 PST