in reply to Re^4: Small Perl 6 discoveries IV, hash access
in thread [Perl6] Perl 6 discoveries IV, hash access

No, I am telling you to use the capabilities of whatever editor you use. Atom for example has support for snippets built in. For others there editor plugins. With little or more effort (depending) you can set up snippets that give you unicode operators.

I use a snippet file for Atom that lets me, for example, type Inf(SHIFT-TAB) and i get the infinity symbol in my editor.


holli

You can lead your users to water, but alas, you cannot drown them.

Replies are listed 'Best First'.
Re^6: Small Perl 6 discoveries IV, hash access
by Anonymous Monk on Oct 09, 2017 at 12:42 UTC
    I'm still not sure what a "snippet" is, but you're definitely telling me that I should invent my own unicode mapping and "with little or more effort" implement it in 672 lines of JSON. If only I weren't so darned lazy.
      > I'm still not sure what a "snippet" is,

      basically the combination of an interactive code template and an abbreviation plus trigger. Sets are activated according to context. (Like Perl mode)

      Here a demo for emacs

      http://youtube.com/watch?v=MayeP8Akwas

      > I should invent my own unicode mapping

      Most editors support the snippet model originating from TextMate, including converters.

      IIRC does Perl 6 allow alternative none unicode versions of it's operators.

      Like >> for »

      Consequently "inventing" a generic and agnostic solution shouldn't be difficult, like typing <<+TAB or oo+BAR (for infinity)

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

        For code points that are to be used more than once, that is a feasible solution. However, if you need arbitrary characters, that you don't know in advance, the situation is more difficult.
      I copy and pasted the operators from the docs and massaged the text into cson by using a simple regex search and replace. Took 15 minutes including testing.


      holli

      You can lead your users to water, but alas, you cannot drown them.
        I just want something that works out of the box, that I don't have to screw around with, that has a reasonable chance of working on a random machine that I find myself sitting in front of, that I can tell people "here use this it will solve your problems", but apparently that doesn't exist.