Fwd: Re: Variables in modules

2017-03-09 Thread Theo van den Heuvel



Is this what you are looking for?

our $IAm is export;
( $IAm = $?FILE ) ~~ s|.*"/"||;

--
Theo van den Heuvel
Van den Heuvel HLT Consultancy


Re: How to defined reversed word in a perl6 grammar ?

2017-03-09 Thread Theo van den Heuvel

however in such a simple case we could just write

token idf { $=[ \w+ ] .uc eq 'WHERE' }> }


cheers,


Theo van den Heuvel schreef op 2017-03-09 19:42:

I use something like

token idf { $=[ \w+ ]  ~~ :i/^ where $/}> }

but there are likely to be simpler solutions.


yary schreef op 2017-03-09 16:12:

The method for defining reserved words in general is to have a rule
that matches them (typically "match anything in this array" or a long
alternation), and then modifying the rules where those reserved words
are not allowed to reject them.

So for that grammar, you want to change "identifier" to reject
:i/WHERE/

The exact method of doing so, I don't know!


--
Theo van den Heuvel
Van den Heuvel HLT Consultancy


Re: How to defined reversed word in a perl6 grammar ?

2017-03-09 Thread Theo van den Heuvel

I use something like

token idf { $=[ \w+ ]  ~~ :i/^ where $/}> }

but there are likely to be simpler solutions.


yary schreef op 2017-03-09 16:12:

The method for defining reserved words in general is to have a rule
that matches them (typically "match anything in this array" or a long
alternation), and then modifying the rules where those reserved words
are not allowed to reject them.

So for that grammar, you want to change "identifier" to reject
:i/WHERE/

The exact method of doing so, I don't know!


--
Theo van den Heuvel
Van den Heuvel HLT Consultancy


Re: Your thoughts on Padre?

2017-03-09 Thread Timo Paulssen
On 09/03/17 08:29, ToddAndMargo wrote:
> https://atom.io/
>
> as it is specifically written for Perl 6

Not quite. It's a general-purpose code editor that you could say comes
from the javascript corner of programming.

However, we do have active devs improving the perl6-related plugins for
atom, so they are generally of high quality.

HTH
  - Timo


Re: How to defined reversed word in a perl6 grammar ?

2017-03-09 Thread Timo Paulssen
Hi,

Wouldn't it be enough to use something that backtracks? As you might
know, "token" is "regex + ratcheting" and "rule" is "token + sigspace".

HTH
  - Timo


Re: issues with

2017-03-09 Thread Timo Paulssen
Hey,

X11::Xlib::Raw is buggy. It has to have all modules it uses internally
inside its "provides" section in the META6.json, otherwise "use" will
not find them.

I'll open a ticket with the module author.

HTH
  - Timo

On 08/03/17 22:08, ToddAndMargo wrote:
> Hi All,
>
> What is wrong with this?
>
> $ perl6 -MX11::Xlib::Raw -e 'say "hi";'
> ===SORRY!===
> Could not find X11::Xlib::Raw::X at line 5 in:
> /home/tony/.perl6
> /usr/share/perl6/site
> /usr/share/perl6/vendor
> /usr/share/perl6
> CompUnit::Repository::AbsolutePath<68732640>
> CompUnit::Repository::NQP<62202240>
> CompUnit::Repository::Perl5<62202280>
>
>
> $ zef install X11::Xlib::Raw
> All candidates are currently installed
> No reason to proceed. Use --force to continue anyway
>
>
> $ zef install X11::Xlib::Raw::X
> ===> Searching for: X11::Xlib::Raw::X
> No candidates found matching: X11::Xlib::Raw::X
>
>
> Many thanks,
> -T
>


Re: Variables in modules

2017-03-09 Thread Timo Paulssen
"my" variables are lexically scoped to the curly braces that contain
them. That means that your $IAm is limited exactly to that init block.
Also, =~ isn't in perl6.

You can put "my $IAm" outside that block and assign to it inside the
block, though.

HTH
  - Timo


Re: Your thoughts on Padre?

2017-03-09 Thread Andreas Mueller

  how funny is that ??   
  =:-)   (please watch the clip)

  but I think we need an editor written in perl6 - not in Java
  ;)

  -am

On 08.03.17 23:29, ToddAndMargo wrote:
> Hi All,
> 
> The guys on the chat line told me to look at
> 
> https://atom.io/
> 
> as it is specifically written for Perl 6

-- 
Andreas Müller - Raum: 35/114b - Tel: 2875