RE: Should a typename be a valid parameter for the LEN function?

From: CFB Software <"CFB>
Date: Mon, 13 Dec 2004 20:57:49 +1030

----boundary-LibPST-iamunique-1621461943_-_-
Content-type: text/plain

> From: H. v. L. [mailto:hvl{([at]})nowhere.xy
> On Mon, 13 Dec 2004 16:55:47 +1030, CFB Software <info{([at]})nowhere.xy
> wrote:
>

> > The built-in function LEN in BlackBox accepts a type T as an actual
> > parameter as well as a variable of type T.

>
> > Is the acceptance of a typename as a parameter intentional or an
> > accident?

>
> In my opinion this is not an accident.
> With one exception, added in BB 1.4 and not existing in Oberon or
> BB 1.3,
> LEN always returns the length of the type, be the parameter a type or a
> variable.
> The exception of course is the explicit reference to a variable via the
> $ operator which moreover must be a string variable.
> All this seems to indicate that originally the type was meant and the
> possibility of a variable was added for convenience.
>
>

Thank you for reminding me that LEN was part of Oberon - I was thinking that
it was introduced during the evolution to Component Pascal.

I've just tried it out on the Win32 ETH Oberon compiler and it unambiguously
rejects a type name as a parameter to LEN with the error message:

"This expression must not be a type or procedure"

However, there are subtle differences between the two language reports:

ETH Oberon-2:
=============

Name - LEN(v, n)

Argument type - v: array; n: integer const.
Result type - LONGINT
Function - length of v in dimension n (first dimension = 0)

Name - LEN(v)

Argument type - v: array <-----------<<<
Result type - LONGINT
Function - equivalent to LEN(v, 0)


OmS Component Pascal:
=====================

Name - LEN(v, x)
Argument type - v: array; x: integer constant
Result type - INTEGER
Function - length of v in dimension x (first dimension = 0)

Name - LEN(v)

Argument type - array type <-----------<<<
Result type - INTEGER
Function - equivalent to LEN(v, 0)

Argument type - String
Result type - INTEGER
Function - length of string (not counting 0X)


So I now agree with you - it does appear that the change was intentional.

Chris Burrows
CFB Software
http://www.cfbsoftware.com




--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-1621461943_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwID4gRnJvbTogSC4gdi4gTC4gW21haWx0bzpodmxA
bGFoaW5pLmRlXVxwYXINCj4gT24gTW9uLCAxMyBEZWMgMjAwNCAxNjo1NTo0NyArMTAzMCwgQ0ZC
IFNvZnR3YXJlIDxpbmZvQGNmYnNvZnR3YXJlLmNvbT5ccGFyDQo+IHdyb3RlOlxwYXINCj5ccGFy
DQo+ID4gVGhlIGJ1aWx0LWluIGZ1bmN0aW9uIExFTiBpbiBCbGFja0JveCBhY2NlcHRzIGEgdHlw
ZSBUIGFzIGFuIGFjdHVhbFxwYXINCj4gPiBwYXJhbWV0ZXIgYXMgd2VsbCBhcyBhIHZhcmlhYmxl
IG9mIHR5cGUgVC5ccGFyDQo+XHBhcg0KPiA+IElzIHRoZSBhY2NlcHRhbmNlIG9mIGEgdHlwZW5h
bWUgYXMgYSBwYXJhbWV0ZXIgaW50ZW50aW9uYWwgb3IgYW5ccGFyDQo+ID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RyZXNzLlxwYXINClxwYXINClNlbmQgYW55
IHByb2JsZW0gcmVwb3J0cyBvciBxdWVzdGlvbnMgcmVsYXRlZCB0byB0aGlzIGVtYWlsIGxpc3Qg
dG8gdGhlIGxpc3Qgb3duZXIgYXRccGFyDQogICBvd25lci1ibGFja2JveEBvYmVyb24uY2hccGFy
DQpccGFyDQpDdXJyZW50IHBvc3RpbmcgcG9saWN5OlxwYXINClxwYXINCmEpIFRvIHBvc3QgeW91
IHNob3VsZCB1c2UgdGhlIHNhbWUgYWRkcmVzcyBieSB3aGljaCB5b3UgYXJlIHN1YnNjcmliZWQg
dG8gdGhlIG1haWxpbmcgbGlzdC4gVGhhdCB3YXksIHRoZSBsaXN0IHNlcnZlciB3aWxsIHJlY29n
bml6ZSB5b3UgYXMgc3Vic2NyaWJlciBhbmQgZm9yd2FyZCB5b3VyIHBvc3RpbmcgaW1tZWRpYXRl
bHksIHdpdGhvdXQgY3JlYXRpbmcgYW55IG92ZXJoZWFkLlxwYXINClxwYXINCmIpIElmLCBmb3Ig
c29tZSByZWFzb24sIHlvdSBjYW5ub3QgcG9zdCBmcm9tIHRoZSBhZGRyZXNzLCBieSB3aGljaCB5
b3UgYXJlIHN1YnNjcmliZWQsIHlvdXIgbWVzc2FnZSB3aWxsIGJlIG1vZGVyYXRlZCB0byBhdm9p
ZCBzcGFtLiBQbGVhc2UgdW5kZXJzdGFuZCB0aGF0IG1vZGVyYXRpb24gd2lsbCBvZnRlbiBjYXVz
ZSBzb21lIGRlbGF5LCBpbiBwYXJ0aWN1bGFyIG92ZXIgd2Vla2VuZHMgb3IgaG9seWRheXN9fQB0
ZWdlcg==


----boundary-LibPST-iamunique-1621461943_-_---
Received on Mon Dec 13 2004 - 11:27:49 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:28 UTC