February 20, 2004
why? that way, it is overloadable. but with automatic, and rather logical behaviour.

just as opAdd overloads + += and all at the same time, too..

"Manfred Nowak" <svv1999@hotmail.com> schrieb im Newsbeitrag news:c13gso$25v7$1@digitaldaemon.com...
> davepermen wrote:
>
> > if the object has a .length property, then opDollar
> > just returns that value. and thats it.
>
> As the standard .length property can be redefined this approach might be too simple.
>
> So long.


February 20, 2004
davepermen wrote:

>no clue, but with a standard swiss keyboard its the top left key, directly
>under esc..  with shift.. (else its §).
>
>the $ is rather bad placed for me (between backspace and enter..)..
>  
>
My point is that most languages are written (and should be written) with the us keyboard in mind, as it's the largest market.  ° isn't on these keyboards (well without the alt combination).

-- 
-Anderson: http://badmama.com.au/~anderson/
February 20, 2004
In article <c142c1$3vs$1@digitaldaemon.com>, Serge K says...
>
>The only european keyboard without (~) is Italian.

So I am particularily lucky?
I know there are other without Alt-126, many are without Alt-123 and Alt-125
(which I have, even if "undocumented").

>But there are TWO Italian keyboard layouts in Windows,
>and the second one actually has (~) and (`).
>You should try to switch to "Italian (142)" layout.

I know, I've already tried.
It's simply not easy to change the position of []{} that are used very
frequently to have Alt-126 and Alt-96 handy. Moreover it doesn't have @.
I wonder why the parenthesis are put in this order: {[]}
Ok, [] are the same keys as (), but why '{' with '/' and '}' with '=' ?
AltGr-7 is not an easy combination to type.

This reminds me something: does anyone has any clue on how to change the Windows keyboard mapping? I could add a bounch of AltGr combination...

I have to do a keyboard driver?

Ciao


February 20, 2004
Roberto Mariottini wrote:
> This reminds me something: does anyone has any clue on how to change the Windows
> keyboard mapping? I could add a bounch of AltGr combination...
> 
> I have to do a keyboard driver?

This is vastly different for Windows9x and for Windows NT(/2k/XP). I think one uses something more like maps and the other something more like DLLs... or they were both DLLs but with different sets of features? I can't remember. Anyway, the keyboard drivers are not compatible.

So, you can use something like this to sort out your problems:

http://www.klm.freeservers.com/Medium/

It is shareware, but with  *un*limited (!) trial. :> The trial features limit it to personal use, i.e. you cannot create drivers to use elsewhere.

-eye

February 20, 2004
Just a few notes here before the original topic gets lost -

1. The original request for negative indices seems to have been spurned.

2. Usage as array[$] or array[last] conflicts with usage as slice[x..$] or slice[x..length].  The slice usage seems better - don't like last+1 or $+1 to indicate ".length".

3.  Also, don't think it is really an operator and in need of opDollar.  The defined usage should be within array brackets only, as $ or length.

-larry

In article <c14hkt$13cr$1@digitaldaemon.com>, davepermen says...
>
>why? that way, it is overloadable. but with automatic, and rather logical behaviour.
>
>just as opAdd overloads + += and all at the same time, too..
>
>"Manfred Nowak" <svv1999@hotmail.com> schrieb im Newsbeitrag news:c13gso$25v7$1@digitaldaemon.com...
>> davepermen wrote:
>>
>> > if the object has a .length property, then opDollar
>> > just returns that value. and thats it.
>>
>> As the standard .length property can be redefined this approach might be too simple.
>>
>> So long.
>
>


February 21, 2004
> >The only european keyboard without (~) is Italian.
>
> So I am particularily lucky?
> I know there are other without Alt-126, many are without Alt-123 and Alt-125
> (which I have, even if "undocumented").

I cannot find european keyboard layout without (~),
and all of them do have "{ }" (=Alt-123 and Alt-125).
Unless you are talking about not Latin layouts - Russian, Greek and alike.
But they are unusable for programmers anyhow, and can be switched to Latin mode.

> >But there are TWO Italian keyboard layouts in Windows,
> >and the second one actually has (~) and (`).
> >You should try to switch to "Italian (142)" layout.
>
> I know, I've already tried.
> It's simply not easy to change the position of []{} that are used very
> frequently to have Alt-126 and Alt-96 handy. Moreover it doesn't have @.

It does. But the key is different :
> > The differences are: < Character : Italian  /  Italian (142) >
> > @ : AltGr-Ò(;)  /  AltGr-Q

> I wonder why the parenthesis are put in this order: {[]}
> Ok, [] are the same keys as (), but why '{' with '/' and '}' with '=' ?
> AltGr-7 is not an easy combination to type.

Who knows!
IMHO it is not a very smart choise. (btw, [] are not at the same keys as ()...)
But it is the standard for at least Danish, Finnish, German, Icelandic, Norwegian, Portuguese, Swedish and Turkish.

> This reminds me something: does anyone has any clue on how to change the Windows keyboard mapping? I could add a bounch of AltGr combination...
>
> I have to do a keyboard driver?

If you use Win2K or WinXP, try this one:
Microsoft Keyboard Layout Creator
http://www.microsoft.com/downloads/details.aspx?FamilyID=fb7b3dcd-d4c1-4943-9c74-d8df57ef19d7&displaylang=en



February 21, 2004
Matthew wrote:

> Interesting point. :)

I retreat from my vote: anonymous slices are too seldom. If reference to the last element of such anonymous slices is needed, it should be made named.

Do not inflate the language with keywords that are used rarely.

By the way: what is the proposed semantic of `a[1..a.length-1][2..last]'?

So long.
February 21, 2004
On Fri, 20 Feb 2004 20:30:43 +0100, Ilya Minkov wrote:

> with  *un*limited (!) trial.

How do you read the license? I only undertsand a limit of 30 days.

So long.
February 23, 2004
In article <opr3ngqey5deu3pf@news.digitalmars.com>, Derek Parnell wrote:
> On Fri, 20 Feb 2004 10:56:38 +1100 (02/20/04 10:56:38)
> , Matthew <matthew.hat@stlsoft.dot.org> wrote:
> 
>> What about a new keyword, 'last'?
> 
> The issue I have with using things that look like identifiers (a.k.a. keywords) is that it takes away yet another 'word' away from our identifer namespace.

This is quite true. Something more context-sensitive would be definitely better, so that the word "last" wouldn't have to be sacrificed for mere array indexing.

C# has some kind of context-sensitive keywords if I recall correctly.

One alternative would be to extend the scope of identifier lookup, so that something[0 .. last] would actually mean the same thing as something[0 .. something.last]. Disclaimer: this one doesn't sound that straightforward to define and implement. And it could result in maintenance and readibility problems. Maybe. But it would be intriguing indeed.

-Antti
February 23, 2004
What is that ? ° lol

C

On Thu, 19 Feb 2004 01:01:20 +0100, davepermen <davepermen@hotmail.com> wrote:

> i hate the $. it reminds me of $variables in php and friends.
>
> ugly ugly ugly.
>
> i'd suggest..the ..
>
> ° is never used yet, is it? ° all the way :D
>
> "C" <dont@respond.com> schrieb im Newsbeitrag
> news:opr3lcnggdehmtou@localhost...
> I like the $, as its common to many languages that use regualr
> expressions.  If this gets adopted the $ gets my vote.
>
> C
>
> On Wed, 18 Feb 2004 16:26:08 +1100, Derek Parnell <Derek.Parnell@No.Spam>
> wrote:
>
>> On Wed, 18 Feb 2004 11:44:13 +1100 (02/18/04 11:44:13)
>> , Matthew <matthew.hat@stlsoft.dot.org> wrote:
>>
>>> Sorry, that's a bad idea.
>>>
>>> The reason is that we're all far too used to using -ve indexes in their
>>> "correct" mathematical context, i.e. a[-1] means get the element 1
>>> before
>>> a[0]
>>>
>>> This comes about from the equivalence between subscripting syntax and
>>> pointer arithmetic. a[i] is equivalent to *(a + i). If i is -ve, then
>>> the
>>> arithmetic is no less valid.
>>>
>>> FYI, I once wrote a string class that committed this and many other
>>> crimes
>>> against good sense. It had a short and miserable life, and only remains
>>> as a
>>> reminder of how crap I once was. (This is actually featured as one of
>>> the
>>> little horrors in Appendix B in my new book "Imperfect C++".)
>>>
>>
>> I tend to agree with you on this Matthew. However the concept of a token
>> that signifies a reference to the last element is still a useful idea.
>> Off the top of my head, I suggest the Regular Expression symbol '$',
>> such that a[$] refers to the last element. Thus things like a[4..$] and
>> a[$-4..$-2], and a[$-var] would all be valid.
>>
>
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/