Re: Simple windows code example needed

2017-01-12 Thread ToddAndMargo

  
  
On 01/11/2017 09:22 PM, Lloyd Fournier
  wrote:


  Ah. If that's the case I have nothing useful to
contribute :|

  LL
  
  
  
On Thu, Jan 12, 2017 at 4:15 PM Brandon Allbery
  
  wrote:


  

  On Thu, Jan 12, 2017 at
12:11 AM, Lloyd Fournier 
wrote:

  say "hello world";
  or on the command line:
  perl6 -e 'say "hello world"'
  
  
  There are no headers :)

  
  

  
  
I parsed that request as
  asking how to write a GUI program, fwiw.
  
  

  
  
  -- 
  

  brandon s allbery kf8nh        
                      sine nomine associates
  allber...@gmail.com
                                 ballb...@sinenomine.net
  unix, openafs, kerberos,
infrastructure, xmonad        http://sinenomine.net

  

  

  


What do you replace in Windows?

 #!/usr/bin/perl6



-- 
~~
Computers are like air conditioners.
They malfunction when you open windows
~~
  



Re: Simple windows code example needed

2017-01-12 Thread ToddAndMargo

On 01/12/2017 12:02 AM, ToddAndMargo wrote:


What do you replace in Windows?

 #!/usr/bin/perl6




Oh I get it.  There is no "#!/usr/bin/perl6" utility in Windows.
You just do it the long way:

   perl6 my_program.pl

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: [perl #130540] [BUG] || && and or cannot be "overloaded"

2017-01-12 Thread Elizabeth Mattijsen

[10:04:44]  re the shortcircuiting behaviour of && || and friends, 
and the fact you cannot override them (RT #130540)
[10:05:09]  I wonder whether we perhaps need a new kind of 
signature that would make this work:
[10:05:20]  sub a(*@a) { dd @a.shift }; my $a = 0; a $a++,$a++; dd 
$a   # sorta expected to see $a = 1 here
[10:05:27]  m: sub a(*@a) { dd @a.shift }; my $a = 0; a $a++,$a++; 
dd $a
[10:05:27] rakudo-moar 8f3476: OUTPUT«0␤Int $a = 2␤»
[10:05:52]  aka, a lazy slurpy signature
[10:06:41]  which would allow && || and friends to become full HLL 
citizens, rather then needing to be handled at codegen level and thus make them 
unoverridable

> On 12 Jan 2017, at 06:28, Lloyd Fournier  wrote:
> 
> There is a &infix:<&&> which might be where some confusion comes from. I 
> guess that's there for meta operators. For example:
> multi sub infix:<&&>("foo","bar") { "win" };
> say "foo" && "bar" # bar
> say  Z&&  # win
> 
> so it does kinda work actually just not as you might expect.
> 
> LL
> 
> 
> On Thu, Jan 12, 2017 at 9:21 AM jn...@jnthn.net via RT 
>  wrote:
> On Tue, 10 Jan 2017 17:59:05 -0800, c...@zoffix.com wrote:
> > On Tue, 10 Jan 2017 16:23:18 -0800, fernandocor...@gmail.com wrote:
> > > If I write another || operator it will continue to use the original
> > > version.
> > >
> > > https://irclog.perlgeek.de/perl6/2017-01-10#i_13895823
> > > 
> >
> > To save other readers sifting through the chan log... Even an only sub
> > doesn't take root:
> >
> >  m: sub infix:<||> ($, $) {"hi"}; say 42 || 55
> >  rakudo-moar 9a11ea: OUTPUT«42␤»
> >
> > This applies to &&, and, or, and I'd guess any shortcurcuiting
> > operator.
> 
> These are special compiler forms that receive special code-gen, due to their 
> shortcircuiting nature, and so do not result in sub calls. Thus there's no 
> sub to override.


how to find libs

2017-01-12 Thread Mueller, Andreas
Hi,

if I wan't to manipulate an image I guess I can use a library with NativeCall.

But what is the right way to find the right library ?
How can I find the right functions in the library and find out what the 
functions can do ?

Andreas

Re: how to find libs

2017-01-12 Thread faraco3
About what functions can do, you have to look at the library 
documentation that you want to use. For example, GNU C library - 
http://www.gnu.org/software/libc/manual/pdf/libc.pdf



On Khamis 12 Jan 2017 05:00 , Mueller, Andreas wrote:

Hi,

if I wan't to manipulate an image I guess I can use a library with NativeCall.

But what is the right way to find the right library ?
How can I find the right functions in the library and find out what the 
functions can do ?

Andreas


Re: how to find libs

2017-01-12 Thread yary
I would do a web search for- image manipulation C library, and then check
out the documentation of the results until you find one that has both
enough documentation that you can understand how to use it, and enough
functionality that you need. I would prefer a c library over C++, I imagine
that would be easier to work with NativeCall.

On Jan 12, 2017 4:26 AM, "Mueller, Andreas" <
andreas.muel...@biologie.uni-osnabrueck.de> wrote:

> Hi,
>
> if I wan't to manipulate an image I guess I can use a library with
> NativeCall.
>
> But what is the right way to find the right library ?
> How can I find the right functions in the library and find out what the
> functions can do ?
>
> Andreas


[perl #130540] [BUG] || && and or cannot be "overloaded"

2017-01-12 Thread via RT
# New Ticket Created by  fernandocor...@gmail.com 
# Please include the string:  [perl #130540]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130540 >


If I write another || operator it will continue to use the original version.

https://irclog.perlgeek.de/perl6/2017-01-10#i_13895823 



Re: [perl #130540] [BUG] || && and or cannot be "overloaded"

2017-01-12 Thread Fernando Oliveira
But should those 2 forms behave differently?

20:40  m: multi infix:<||>(42, 42) {"OK"}; say infix:<||>(42, 
42); say 42 || 42
20:40  rakudo-moar 8f3476: OUTPUT«OK␤42␤»

Enviado do meu iPhone

> Em 11 de jan de 2017, às 20:20, jn...@jnthn.net via RT 
>  escreveu:
> 
>> On Tue, 10 Jan 2017 17:59:05 -0800, c...@zoffix.com wrote:
>>> On Tue, 10 Jan 2017 16:23:18 -0800, fernandocor...@gmail.com wrote:
>>> If I write another || operator it will continue to use the original
>>> version.
>>> 
>>> https://irclog.perlgeek.de/perl6/2017-01-10#i_13895823
>>> 
>> 
>> To save other readers sifting through the chan log... Even an only sub
>> doesn't take root:
>> 
>>  m: sub infix:<||> ($, $) {"hi"}; say 42 || 55
>>  rakudo-moar 9a11ea: OUTPUT«42␤»
>> 
>> This applies to &&, and, or, and I'd guess any shortcurcuiting
>> operator.
> 
> These are special compiler forms that receive special code-gen, due to their 
> shortcircuiting nature, and so do not result in sub calls. Thus there's no 
> sub to override.
> 


Re: Simple windows code example needed

2017-01-12 Thread Parrot Raiser
"There is no "#!/usr/bin/perl6" utility in Windows".
That's not a utility, as such, it's telling the shell where the
program was invoked, which  interpreter to use. Windows ignores the !#
line, because it uses the file-type suffix to find the information.

On 1/12/17, ToddAndMargo  wrote:
> On 01/12/2017 12:02 AM, ToddAndMargo wrote:
>>
>> What do you replace in Windows?
>>
>>  #!/usr/bin/perl6
>>
>>
>
> Oh I get it.  There is no "#!/usr/bin/perl6" utility in Windows.
> You just do it the long way:
>
> perl6 my_program.pl
>
> --
> ~~
> Computers are like air conditioners.
> They malfunction when you open windows
> ~~
>


Re: Simple windows code example needed

2017-01-12 Thread Parrot Raiser
P.S. I just noticed your "long way": perl6 my_program.pl

If you are invoking the script as an argument to perl6, you don't need
a suffix. Windows needs the .pl suffix to decide what to do with the
file. If you have Perl 5, you are likely have .pl linked to it. I'd
suggest a separate value, perhaps p6, so the system can discriminate
between the two.


Re: [perl #130540] [BUG] || && and or cannot be "overloaded"

2017-01-12 Thread Bart Wiegmans
I'm not sure if this adds anything, but:
The reason why infix<||> doesn't work as you'd expect, is that operators
like '||' and '&&' operate on expressions, that is to say code, rather than
on values.
The only valid way to extend such operators is to either use macros (which
would receive both sides as arguments) or to create 'thunks' out of both
sides.
Either way, a sub that takes value arguments is incompatible with the
short-circuiting semantics, and I think it should fail at compile time.

Regards,
Bart

2017-01-11 23:42 GMT+01:00 Fernando Oliveira :

> But should those 2 forms behave differently?
>
> 20:40  m: multi infix:<||>(42, 42) {"OK"}; say
> infix:<||>(42, 42); say 42 || 42
> 20:40  rakudo-moar 8f3476: OUTPUT«OK␤42␤»
>
> Enviado do meu iPhone
>
> > Em 11 de jan de 2017, às 20:20, jn...@jnthn.net via RT <
> perl6-bugs-follo...@perl.org> escreveu:
> >
> >> On Tue, 10 Jan 2017 17:59:05 -0800, c...@zoffix.com wrote:
> >>> On Tue, 10 Jan 2017 16:23:18 -0800, fernandocor...@gmail.com wrote:
> >>> If I write another || operator it will continue to use the original
> >>> version.
> >>>
> >>> https://irclog.perlgeek.de/perl6/2017-01-10#i_13895823
> >>> 
> >>
> >> To save other readers sifting through the chan log... Even an only sub
> >> doesn't take root:
> >>
> >>  m: sub infix:<||> ($, $) {"hi"}; say 42 || 55
> >>  rakudo-moar 9a11ea: OUTPUT«42␤»
> >>
> >> This applies to &&, and, or, and I'd guess any shortcurcuiting
> >> operator.
> >
> > These are special compiler forms that receive special code-gen, due to
> their shortcircuiting nature, and so do not result in sub calls. Thus
> there's no sub to override.
> >
>