2017 up to now  | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries of 2007

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

[QF-Test] Propogating procedure paremter values / forcing immediate expansion

  • Subject: [QF-Test] Propogating procedure paremter values / forcing immediate expansion
  • From: "Adrian Chamberlain (BE/ETL)" <adrian.chamberlain@?.com>
  • Date: Thu, 21 Jun 2007 14:52:52 +0200

I have a small problem concerning procedure parameter values and variable 
bindings which I would appreciate some input on.
Example test-suite is attached.
We have Procedure A which has three parameters 'child', 'parent' and 
We have procedure B which has two parameters 'child' and 'parent'.
We call procedure A with the values 'child1', 'parent1' and 'grandparent1'
call procedure A('child1', 'parent1' 'grandparent1')
Procedure A in turn calls procedure B as follows:
call procedure B($(parent), $(grandparent))
This means of course that procedure B will have the following variable
'child'  with value of $(parent)
'parent'  with value of $(grandparent)
The problem here is that this results in the parameter 'child' expanding to 
the value 'grandparent1'  as apposed to 'parent1' !!
Obviously I need the call to procedure B to pass expanded variable
values (i.e. the paramters to procedure A)  to avoid this situation.  In otherwords I 
need to force immediate variable expansion within procedure A.
At present the only way I know how to force immediate variable
expansion is through the use of the set variable node.
Greg mentioned some months ago that new syntax variants would be introduced
 i.e. $!(variable)  and $_(variable).  
$!(variable) would force immediate variable expansion.
This I presume would allow me to achieve the following in procedure A :
call procedure B($!(parent), $!(grandparent)), therefore avoiding the introduction
of set variable nodes and consequently procedure B would have the desired 
'child' with value of 'parent1'
'parent' with value of 'grandparent1'
Are you still planning to introduce these new syntax variants ? 
Thank you in advance for your help
Kind Regards

Attachment: lazy1.qft
Description: lazy1.qft