[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
CHILL does not permit the writing of procedures with parameters of any type. Yet some interfaces--in particular those to system calls--require the handling of a wide range of modes, e.g. any string mode, any structure mode, or any powerset mode. This could be handled by specifying two parameters (PTR, INT for the length) but this is error-prone (no guarantee the same location is used after in ADDR and LENGTH), and it will not be possible for expressions.
Caveats: This feature permits the programmer to obtain the address of a literal (if the compiler takes this shortcut--see 1st example below). If hardware features protect constant parts of the program, erronous abuse will be detected.
Examples: OFFER_HANDLER( descr("dbs"), ->dbs);
SYNMODE m_els = SET( ela, elb, elc ); SYNMODE m_elsel = POWERSET m_els; DCL user_buf STRUCT( a mx, b my, c mz); DCL select POWERSET m_elsel;
select := m_elsel[LOWER(m_els) : UPPER(m_els)];
GET_RECORD( relation, recno, descr(user_buf), descr(select) );
PUT_RECORD( relation, recno, descr(user_buf.b), descr(m_elsel[elb]) );
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |