Thread overview
delete on arrays and associative arrays
Dec 10, 2003
Charles Sanders
Dec 10, 2003
Ilya Minkov
Dec 12, 2003
J Anderson
December 10, 2003
Using delete on an associative array will remove the element and resize the array .

Using delete on a dynamic ( or otherwise ) array will just leave a blank spot in the middle of the array, not resizing.

Could we have a 'remove' property that will remove the element , and resize the array ?

I think this would go along way to help make the language more consistent and useful.


C


December 10, 2003
I suggest array and other language primitives which can be expressed as structs get their place as structs in the standard library. Some syntax would translate to certain methods, but also all other methods and propeties should be acessible directly. A compiler switch or inifile setting should specify in which namespace to look for definitions.

This would allow the Standard Library group to enhance basic types.

-eye

In article <br7v4r$1lki$1@digitaldaemon.com>, Charles Sanders says...
>
>Using delete on an associative array will remove the element and resize the array .
>
>Using delete on a dynamic ( or otherwise ) array will just leave a blank spot in the middle of the array, not resizing.
>
>Could we have a 'remove' property that will remove the element , and resize the array ?
>
>I think this would go along way to help make the language more consistent and useful.
>
>
>C
>
>


December 12, 2003
Ilya Minkov wrote:

>I suggest array and other language primitives which can be expressed as structs
>get their place as structs in the standard library. Some syntax would translate
>to certain methods, but also all other methods and propeties should be acessible
>directly. A compiler switch or inifile setting should specify in which namespace
>to look for definitions.
>
>This would allow the Standard Library group to enhance basic types.
>
>-eye
>
>In article <br7v4r$1lki$1@digitaldaemon.com>, Charles Sanders says...
>  
>
>>Using delete on an associative array will remove the element and resize the
>>array .
>>
>>Using delete on a dynamic ( or otherwise ) array will just leave a blank
>>spot in the middle of the array, not resizing.
>>
>>Could we have a 'remove' property that will remove the element , and resize
>>the array ?
>>
>>I think this would go along way to help make the language more consistent
>>and useful.
>>
>>
>>C
>>
>>
>>    
>>
>
>  
>

Parhaps something like:

extend int
{
   void remove(...) ...
}

Allowing anyone to add methods to the standard primitive (it could be used for classes as well but then it might take the place of inheritance). 

PS - I suggested this before for operator overloading, for the _r side, before it was implemented.