PR# 5366 Please add a bracket alias to NATIVE_ARRAY

Problem Report Summary
Submitter: peter_gummer
Category: EiffelStudio
Priority: Medium
Date: 2005/08/01
Class: Feature Request
Severity: Non-critical
Number: 5366
Release: 5.6.1128
Confidential: No
Status: Analyzed
Environment: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Synopsis: Please add a bracket alias to NATIVE_ARRAY

Please add a bracket alias to NATIVE_ARRAY.

This code produces the following error:

	create args.make (1)
	args [0] := 1

Error code: VWBR(1)
Error: no feature with bracket alias is found in target class of bracket expression.
To Reproduce

Problem Report Interactions
From:peter_gummer    Date:2009/07/30    Download   
This touches on one thing that I don't like about the Eiffel libraries, Manu, although I know it won't change. The Eiffel convention of placing the value before the index or key has always felt backwards to me. And it still feels the same. In .NET and Delphi, the convention is that the index or key goes first, i.e., put(i, value); thus, the position of the index or key is consistent with get(i). This still feels far more natural to me than the Eiffel convention.

I submitted this request for a bracket alias on NATIVE_ARRAY in my early days of Eiffel programming. Back then, the Eiffel habit of using 'put' procedures felt very unnatural to me, as if I had gone back ten years to programming in C. Since then I've got used to it. So, to answer your question directly, no this is not something that I've felt the need for again.

However I don't think you should close this issue. Although I personally no longer want it, this request was feedback from someone who was new to Eiffel. Many programmers coming to Eiffe
Output truncated, Click download to get the full message

From:manus_eiffel    Date:2009/07/30    Status: Analyzed    Download   
Unfortunately this is not possible because the signature of `put' in NATIVE_ARRAY does not match the specification required for allowing the bracket notation. It should be:

  put (v: T; i: INTEGER)

but unfortunately is:

  put (i: INTEGER; v: T)


We could possibly add `slow_put' with the proper signature and have the bracket supported but that would be slightly slower since the code generation would need to store some arguments to locals to take into account the reversal of arguments.

Is this still something you would like to have?

From:peter_gummer    Date:2005/11/11    Download