Loading ...
Sorry, an error occurred while loading the content.

Re: Problem with list indexes solved

Expand Messages
  • drchip@campbellfamily.biz
    ... Things to consider... Operators ==# !=# ...
    Message 1 of 19 , May 18, 2005
    • 0 Attachment
      Quoting Bram Moolenaar <Bram@...>:

      > I now implemented it using the '#' character. It appears to work and
      > not cause side effects. Example:
      >
      > let x = myscript#myfunc()
      >
      > Any objections to using '#' for this?

      Things to consider...

      Operators
      ==#
      !=#
      >#
      >=#
      <#
      <=#
      =~#
      !~#

      Abbreviations:
      :cnoreab ##h <C-R>=expand('#:p:h')<CR>

      Edit alternate file, etc
      :e #1

      Naturally, there's a lot of strings and comments with "#" in it.

      cmdline.txt says:

      When you want to use the special characters '"' or '|' in a command, or
      want to use '%' or '#' in a file name, precede them with a backslash.

      Consider filename modifiers (can be used after % # etc)

      Terminal stuff (ex. t_#4)

      Regards,
      Chip Campbell
    • Bram Moolenaar
      ... No problem, these all have a non-letter before them. ... Can t take abbreviations into account, the user can abbreviate anything. ... No expression used
      Message 2 of 19 , May 18, 2005
      • 0 Attachment
        Chip Campbell wrote:

        > Quoting Bram Moolenaar <Bram@...>:
        >
        > > I now implemented it using the '#' character. It appears to work and
        > > not cause side effects. Example:
        > >
        > > let x = myscript#myfunc()
        > >
        > > Any objections to using '#' for this?
        >
        > Things to consider...
        >
        > Operators
        > ==#
        > !=#
        > >#
        > >=#
        > <#
        > <=#
        > =~#
        > !~#

        No problem, these all have a non-letter before them.

        > Abbreviations:
        > :cnoreab ##h <C-R>=expand('#:p:h')<CR>

        Can't take abbreviations into account, the user can abbreviate anything.

        > Edit alternate file, etc
        > :e #1

        No expression used here.

        > Naturally, there's a lot of strings and comments with "#" in it.

        But no expression.

        > cmdline.txt says:
        >
        > When you want to use the special characters '"' or '|' in a command, or
        > want to use '%' or '#' in a file name, precede them with a backslash.
        >
        > Consider filename modifiers (can be used after % # etc)

        Doesn't apply to an expression.

        > Terminal stuff (ex. t_#4)

        &t_#4 doesn't work now either.

        --
        BEDEVERE: Look! It's the old man from scene 24 - what's he Doing here?
        ARTHUR: He is the keeper of the Bridge. He asks each traveler five
        questions ...
        GALAHAD: Three questions.
        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
      • Alexei Alexandrov
        ... What about using more natural myscript::myfunc() ? Sorry if it s more natural only for me... -- Alexei Alexandrov
        Message 3 of 19 , May 18, 2005
        • 0 Attachment
          Hi Bram Moolenaar, you wrote:

          >
          > I now implemented it using the '#' character. It appears to work and
          > not cause side effects. Example:
          >
          > let x = myscript#myfunc()
          >
          > Any objections to using '#' for this?
          >

          What about using more natural myscript::myfunc() ?

          Sorry if it's more natural only for me...

          --
          Alexei Alexandrov
        • Marian Csontos
          On Wed, 18 May 2005 21:31:49 +0200, Alexei Alexandrov ... For me too, but it doesn t matter whether it will be # or ::, as long as it solves confusion it is
          Message 4 of 19 , May 19, 2005
          • 0 Attachment
            On Wed, 18 May 2005 21:31:49 +0200, Alexei Alexandrov
            <alexei1.alexandrov2@...> wrote:

            > Hi Bram Moolenaar, you wrote:
            >
            >>
            >> I now implemented it using the '#' character. It appears to work and
            >> not cause side effects. Example:
            >>
            >> let x = myscript#myfunc()
            >>
            >> Any objections to using '#' for this?
            >>
            >
            > What about using more natural myscript::myfunc() ?
            >
            > Sorry if it's more natural only for me...
            >

            For me too, but it doesn't matter whether it will be # or ::,
            as long as it solves confusion it is good solution.

            Isn't :: simpler to type for touch typists?

            -- Marian


            ________ Information from NOD32 ________
            This message was checked by NOD32 Antivirus System for Linux Mail Server.
            http://www.nod32.com
          • A. J. Mechelynck
            Marian Csontos wrote: [...] ... That may depend on the particular keyboard layout used, and should not be relied upon. On my Belgian AZERTY keyboard, # is
            Message 5 of 19 , May 19, 2005
            • 0 Attachment
              Marian Csontos wrote:
              [...]
              > For me too, but it doesn't matter whether it will be # or ::,
              > as long as it solves confusion it is good solution.
              >
              > Isn't :: simpler to type for touch typists?
              >
              > -- Marian

              That may depend on the particular keyboard layout used, and should not
              be relied upon. On my Belgian AZERTY keyboard, # is Alt-Gr 3 while : is
              unshifted, second from bottom right (IIUC, on the key where US QWERTY
              keyboards have the period), so :: is easier; but I wouldn't bet that it
              isn't the opposite on some national keyboards.

              Best regards,
              Tony.
            • Milan Vancura
              ... Yes, for example there is no way to type # on standard Czech QWERTZ keyboard. There is a question - of course - if programmer uses US keymap or Czech one.
              Message 6 of 19 , May 19, 2005
              • 0 Attachment
                > That may depend on the particular keyboard layout used, and should not
                > be relied upon. On my Belgian AZERTY keyboard, # is Alt-Gr 3 while : is

                Yes, for example there is no way to type # on standard Czech QWERTZ keyboard.
                There is a question - of course - if programmer uses US keymap or Czech one. I
                vote for :: because this is easy to type in all keymaps I know (US, Czech,
                German) and highly probably in other European ones. (I don't know anything
                about Asian ones.)

                Milan Vancura
              • A. J. Mechelynck
                ... In other programs maybe, but in Vim you can always do ^KNb (Control-K, big-enn, small-bee). I notice that you typed it in your mail, even though you are a
                Message 7 of 19 , May 19, 2005
                • 0 Attachment
                  Milan Vancura wrote:
                  >>That may depend on the particular keyboard layout used, and should not
                  >>be relied upon. On my Belgian AZERTY keyboard, # is Alt-Gr 3 while : is
                  >
                  >
                  > Yes, for example there is no way to type # on standard Czech QWERTZ keyboard.

                  In other programs maybe, but in Vim you can always do ^KNb (Control-K,
                  big-enn, small-bee). I notice that you typed it in your mail, even
                  though you are a Czech. Maybe you used Alt-35 or some such? Have you
                  tried Alt-Gr 3 or Ctrl-Alt-3 on a Czech QWERTZ keyboard? No promises,
                  but just maybe you might be surprised.

                  > There is a question - of course - if programmer uses US keymap or Czech one. I

                  Yes, # is needed for comments in some languages such as Bash scripts,
                  and IIRC all Perl program must have #!/bin/perl (or some such) on their
                  first line, so programmers had better know how to input it.

                  > vote for :: because this is easy to type in all keymaps I know (US, Czech,
                  > German) and highly probably in other European ones. (I don't know anything
                  > about Asian ones.)
                  >
                  > Milan Vancura

                  Well, I vote for :: too but I wouldn't fight very hard against #.

                  Best regards,
                  Tony.
                • Marian Csontos
                  Some kind of FeatureZilla would be useful, to vote and discuss about features to be implemented in vim. CTRL-K SHIFT-N B and ALT-NUM3-NUM5 - looks like emacs
                  Message 8 of 19 , May 19, 2005
                  • 0 Attachment
                    Some kind of FeatureZilla would be useful,
                    to vote and discuss about features to be implemented in vim.

                    CTRL-K SHIFT-N B and ALT-NUM3-NUM5 - looks like emacs :-)

                    but I doubt somebody is using as abnormal keyboard as czech and slovak
                    when writing vim scripts, there is too many special chars to write: |, \,
                    all kind of parethesis...

                    Function-name-completion suggestion:
                    it could work like filename completion - to complete to first delimiter
                    only

                    -- Marian


                    ________ Information from NOD32 ________
                    This message was checked by NOD32 Antivirus System for Linux Mail Server.
                    http://www.nod32.com
                  • Milan Vancura
                    ... Of course, you can type it in some way: Ctrl-(Left Alt)-X on Czech MS Windows, switch to US keymap, use Vim features... For example I use UCW keymap which
                    Message 9 of 19 , May 19, 2005
                    • 0 Attachment
                      > > Yes, for example there is no way to type # on standard Czech QWERTZ keyboard.
                      >
                      > In other programs maybe, but in Vim you can always do ^KNb (Control-K,

                      Of course, you can type it in some way: Ctrl-(Left Alt)-X on Czech MS Windows,
                      switch to US keymap, use Vim features... For example I use UCW keymap which
                      gives me the great posibility to use Czech letters and US keymap at once so I
                      have personaly no problems with #. And programmers use US keymap...

                      > Well, I vote for :: too but I wouldn't fight very hard against #.

                      Same for me.

                      Milan
                    • A. J. Mechelynck
                      ... No insults, please ;-). ^KNb is the standard Vim digraph for Nb (number sign). Alt-35 is not Vim, but Dos/Windows for ASCII 35, i.e. # (Vim would use ^V035
                      Message 10 of 19 , May 19, 2005
                      • 0 Attachment
                        Marian Csontos wrote:
                        > Some kind of FeatureZilla would be useful,
                        > to vote and discuss about features to be implemented in vim.
                        >
                        > CTRL-K SHIFT-N B and ALT-NUM3-NUM5 - looks like emacs :-)

                        No insults, please ;-). ^KNb is the standard Vim digraph for Nb (number
                        sign). Alt-35 is not Vim, but Dos/Windows for ASCII 35, i.e. # (Vim
                        would use ^V035 or ^Vx23 in that case).

                        Alt-Gr 3 or Ctrl-Alt 3 exists on my keyboard and possibly on others.

                        >
                        > but I doubt somebody is using as abnormal keyboard as czech and slovak
                        > when writing vim scripts, there is too many special chars to write: |,
                        > \, all kind of parethesis...

                        :-)
                        >
                        > Function-name-completion suggestion:
                        > it could work like filename completion - to complete to first delimiter
                        > only
                        >
                        > -- Marian

                        [advertisement snipped ]


                        Best regards,
                        Tony.
                      • Bram Moolenaar
                        ... You must be using C++. Note that the meaning in Vim is unlike C++, it s more like a path separator (we can t use / , it means division). We already use
                        Message 11 of 19 , May 19, 2005
                        • 0 Attachment
                          Alexei Alexandrov wrote:

                          > Hi Bram Moolenaar, you wrote:
                          >
                          > > I now implemented it using the '#' character. It appears to work and
                          > > not cause side effects. Example:
                          > >
                          > > let x = myscript#myfunc()
                          > >
                          > > Any objections to using '#' for this?
                          >
                          > What about using more natural myscript::myfunc() ?
                          >
                          > Sorry if it's more natural only for me...

                          You must be using C++. Note that the meaning in Vim is unlike C++,
                          it's more like a path separator (we can't use '/', it means division).
                          We already use the dot for dict.FuncRef, that's more like what C++ uses
                          it for (but still not the same).

                          "::" is two characters, '#' is only one. Shorter is better.

                          For the implementation it's a bit more complicated to check for "::".

                          --
                          BRIDGEKEEPER: What is your favorite editor?
                          GAWAIN: Emacs ... No, Viiiiiiiiiiimmmmmmm!
                          "Monty Python and the Holy editor wars" PYTHON (MONTY) SOFTWARE LTD

                          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                          /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                          \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                          \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
                        • Bram Moolenaar
                          ... I don t see an advantage in using @ over # . @ is used for registers, as in @r. Although I don t see a semantical conflict, it might be confusing.
                          Message 12 of 19 , May 19, 2005
                          • 0 Attachment
                            Alexei Alexandrov wrote:

                            > On 5/19/05, Bram Moolenaar <Bram@...> wrote:
                            > >
                            > > You must be using C++. Note that the meaning in Vim is unlike C++,
                            > > it's more like a path separator (we can't use '/', it means division).
                            > > We already use the dot for dict.FuncRef, that's more like what C++ uses
                            > > it for (but still not the same).
                            > >
                            > > "::" is two characters, '#' is only one. Shorter is better.
                            > >
                            > > For the implementation it's a bit more complicated to check for "::".
                            > >
                            >
                            > OK, I'm just trying to think about a syntax which could be logical.
                            > Choosing '#' (which is usually used as 'number') seems not to be very
                            > straightforward. But people can get used to anything... :-)
                            >
                            > Another idea: what about using @ (at) symbol? But function and script
                            > names would have to be reversed: like myfunction()@myscript. Seems
                            > very logical myfunction() at myscript. But there might be other
                            > conflicts with Vim scripting language probably.

                            I don't see an advantage in using '@' over '#'. '@' is used for
                            registers, as in @r. Although I don't see a semantical conflict, it
                            might be confusing.

                            I'm using Python for ideas, and in Python # starts a comment. That
                            means Python doesn't use # in an expression, thus there won't be a
                            conflict from that side. In Vim we use " to start a comment, thus the
                            '#' can be used for something else.

                            --
                            A special law prohibits unmarried women from parachuting on Sunday or she
                            shall risk arrest, fine, and/or jailing.
                            [real standing law in Florida, United States of America]

                            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                            /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                            \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                            \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
                          • Marian Csontos
                            On Thu, 19 May 2005 11:02:32 +0200, Bram Moolenaar ... and concatenation too (another source of confusion?) In typed languages operator
                            Message 13 of 19 , May 19, 2005
                            • 0 Attachment
                              On Thu, 19 May 2005 11:02:32 +0200, Bram Moolenaar <Bram@...>
                              wrote:
                              >
                              > Alexei Alexandrov wrote:
                              >> What about using more natural myscript::myfunc() ?
                              >>
                              >> Sorry if it's more natural only for me...
                              >
                              > You must be using C++. Note that the meaning in Vim is unlike C++,
                              > it's more like a path separator (we can't use '/', it means division).
                              > We already use the dot for dict.FuncRef, that's more like what C++ uses
                              > it for (but still not the same).

                              and concatenation too (another source of confusion?)
                              In typed languages operator overloading is fine, but in vim doesn't seems
                              good to me - one has to study code what is its meaning

                              > "::" is two characters, '#' is only one. Shorter is better.

                              not allways... e.g. ^KNb as Tony wrote. : is more commonly used so better
                              placed,...

                              > For the implementation it's a bit more complicated to check for "::".

                              ...but this sounds reasonably. No more objections, can get used to #.

                              -- Marian


                              ________ Information from NOD32 ________
                              This message was checked by NOD32 Antivirus System for Linux Mail Server.
                              http://www.nod32.com
                            • Mikolaj Machowski
                              ... Even on Polish programmist (de facto US keyboard with support for AltGr) it may be easier to type double shift-; than single shift-3 m. -- LaTeX + Vim =
                              Message 14 of 19 , May 19, 2005
                              • 0 Attachment
                                Dnia czwartek 19 maj 2005 09:42, Milan Vancura napisaƂ:
                                > Yes, for example there is no way to type # on standard Czech QWERTZ
                                > keyboard. There is a question - of course - if programmer uses US keymap
                                > or Czech one. I vote for :: because this is easy to type in all keymaps
                                > I know (US, Czech, German) and highly probably in other European ones.
                                > (I don't know anything about Asian ones.)

                                Even on Polish programmist (de facto US keyboard with support for AltGr) it
                                may be easier to type double shift-; than single shift-3

                                m.
                                --
                                LaTeX + Vim = http://vim-latex.sourceforge.net/
                                Vim-list(s) Users Map: (last change 15 May)
                                http://skawina.eu.org/mikolaj/vimlist
                                CLEWN - http://clewn.sf.net
                              • Eljay Love-Jensen
                                Hi Bram, ... U+2237 is only one character... http://www.fileformat.info/info/unicode/char/2237/index.htm ... Humorously, --Eljay
                                Message 15 of 19 , May 19, 2005
                                • 0 Attachment
                                  Hi Bram,

                                  >"::" is two characters, '#' is only one. Shorter is better.

                                  U+2237 is only one character...
                                  http://www.fileformat.info/info/unicode/char/2237/index.htm

                                  :-)

                                  Humorously,
                                  --Eljay
                                • A. J. Mechelynck
                                  ... keystrokes including a double one: Ctrl-V u 2 2 3 7 # is 7-bit ASCII and requires (in Vim) between 1 and 3 keystrokes depending on your keyboard layout ...
                                  Message 16 of 19 , May 19, 2005
                                  • 0 Attachment
                                    Eljay Love-Jensen wrote:
                                    > Hi Bram,
                                    >
                                    >
                                    >>"::" is two characters, '#' is only one. Shorter is better.
                                    >
                                    >
                                    > U+2237 is only one character...
                                    > http://www.fileformat.info/info/unicode/char/2237/index.htm
                                    >
                                    > :-)
                                    >
                                    > Humorously,
                                    > --Eljay
                                    >
                                    >
                                    >
                                    >
                                    :-) Maybe, but in Vim it requires both (a) Unicode encoding and (b) six
                                    keystrokes including a double one: Ctrl-V u 2 2 3 7

                                    # is 7-bit ASCII and requires (in Vim) between 1 and 3 keystrokes
                                    depending on your keyboard layout

                                    :: (two colons) is 7-bit ASCII and is always two keystrokes AFAIK.

                                    Of course, anything frequently used can be mapped.


                                    Best regards,
                                    Tony.
                                  • Gary Johnson
                                    ... I know this depends on one s experience, but :: just looks right. As for it being two characters, there are already two-character tokens in vim such as &&
                                    Message 17 of 19 , May 19, 2005
                                    • 0 Attachment
                                      On 2005-05-19, Milan Vancura <milanek@...> wrote:

                                      > > Well, I vote for :: too but I wouldn't fight very hard against #.
                                      >
                                      > Same for me.

                                      I know this depends on one's experience, but :: just looks right.

                                      As for it being two characters, there are already two-character
                                      tokens in vim such as && and ||, and I don't think it is ambiguous.

                                      Just my $0.02.

                                      Gary

                                      --
                                      Gary Johnson | Agilent Technologies
                                      garyjohn@... | Wireless Division
                                      | Spokane, Washington, USA
                                    Your message has been successfully submitted and would be delivered to recipients shortly.