[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non-member submission:RE: Implicit variables - should they be reserved keywords?



From: "Blackmore Tim (DC BRS)" <Tim.Blackmore@infineon.com>
To: "'Andrew Piziali'" <andy@verisity.com>,
        "Galpin Darren (DC BRS)"
	 <darren.galpin@infineon.com>
Cc: 1647-l@ieee1647.org
Subject: RE: Implicit variables - should they be reserved keywords?
Date: Fri, 9 Jan 2004 13:11:46 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain

Andrew,

it was me that originally raised this query with Darren. I'm not sure what
you mean by


'The reason they are not keywords is because each is an implicitly
declared var within the scope of its action block.'

Certainly the reason why the two pieces of code behave as they do is clear.
The problem is that if a user forgot that "result" was an implicit variable
for a value-returning method then that user may expect the two pieces of
code to give the same "result". It seems to me that a good reason for making
a word reserved is to prevent the risk of such things happening.


Tim.

-----Original Message-----
From: Andrew Piziali [mailto:andy@verisity.com]
Sent: 09 January 2004 13:01
To: Galpin Darren (DC BRS)
Cc: 1647-l@ieee1647.org; Blackmore Tim (DC BRS)
Subject: RE: Implicit variables - should they be reserved keywords?


Darren, you wrote:


  Following a discussion with an engineer who is just starting with e,
  I was wondering why implicit variables (result, it, me etc..) are
  not reserved keywords.  Take the following two code examples: ...

The reason they are not keywords is because each is an implicitly declared var within the scope of its action block. This explains why an assignment to "result" in a value-returning method does not change the value of a field named "result" while the same assignment in a method does.



--
        Andrew Piziali, <andy@verisity.com>, +1-972-516-3773

"Even when performance modeling requires a cycle-accurate model early in
the project, an architecture that treats timing as an orthogonal ASPECT
[my emphasis] seems advantageous from a software engineering viewpoint."
        -- GreenLight Pivot User, 12/02