Re: A funny module that shortens one-liners - is it worth global namespace?

2017-01-08 Thread Konstantin S. Uvarin
Hi Aristotle,

  Thanks for the aliased link, looks like it covers the need, too.

On Mon, Jan 9, 2017 at 2:43 AM, Aristotle Pagaltzis 
wrote:

> * Aristotle Pagaltzis  [2017-01-09 01:42]:
> > * Konstantin S. Uvarin  [2016-12-27 11:24]:
> > > perl -Mnew=x=My::Very::Long::Module,foo,42 -we "print $x->foo;"
> >
> >   perl -Maliased=My::Very::Long::Module,X -we 'print X->new( foo => 42
> )'
>
> Err.
>
> perl -Maliased=My::Very::Long::Module,X -we 'print X->new( foo => 42
> )->foo'
>



-- 
Konstantin S. Uvarin
jabber: see 
skype: kuvarin
http://github.com/dallaylaen


Re: A funny module that shortens one-liners - is it worth global namespace?

2017-01-08 Thread Aristotle Pagaltzis
* Aristotle Pagaltzis  [2017-01-09 01:42]:
> * Konstantin S. Uvarin  [2016-12-27 11:24]:
> > perl -Mnew=x=My::Very::Long::Module,foo,42 -we "print $x->foo;"
>
>   perl -Maliased=My::Very::Long::Module,X -we 'print X->new( foo => 42 )'

Err.

perl -Maliased=My::Very::Long::Module,X -we 'print X->new( foo => 42 )->foo'


Re: A funny module that shortens one-liners - is it worth global namespace?

2017-01-08 Thread Aristotle Pagaltzis
Hi Konstantin,

* Konstantin S. Uvarin  [2016-12-27 11:24]:
>   I've come up with an interface to shorten that to just
>
>   perl -Mnew=x=My::Very::Long::Module,foo,42 -we "print $x->foo;"

maybe https://metacpan.org/pod/aliased is good enough?

perl -Maliased=My::Very::Long::Module,X -we 'print X->new( foo => 42 )'

I don’t know if that’s enough magic for you, though.

Personally I find it a lot more obvious what’s going on there compared
to your proposed interface. I’m sure I would never need to look at the
docs to decipher what that line was supposed to be doing.

Regards,
-- 
Aristotle Pagaltzis // 


Re: A funny module that shortens one-liners - is it worth global namespace?

2017-01-03 Thread Smylers
Konstantin S. Uvarin writes:

> Hello everyone,
> 
> >  1perl -e '$x = My::Very::Long::Module->new( foo => 42 ); print $x->foo'
> 
> Good point. And there's also L module https://metacpan.org/pod/L which
> does more or less what I propose.

L looks to be the equivalent of Class::Autouse :superloader, but
slightly different from your proposal — it still requires typing the
‘new’.

> So I think this topic is covered. =)

Your variation is as valid as anybody else's. If you prefer the syntax
or particularly way of working with your module rather than the existing
ones, then others might too. Don't be discouraged from publishing yours
as an alternative for users to choose from.

Smylers
-- 
http://twitter.com/Smylers2


Re: A funny module that shortens one-liners - is it worth global namespace?

2016-12-27 Thread David Mertens
Based on Reini's comment, "Stasher" came to mind. Short, unique, not taken,
not likely to bother anybody. That's not the right word, but maybe it gives
you some ideas.

David

On Tue, Dec 27, 2016 at 5:29 AM, Reini Urban  wrote:

>
> > On Dec 27, 2016, at 11:20 AM, Konstantin S. Uvarin 
> wrote:
> >
> > Hello everyone,
> >
> >   I've come up with idea or a module that shortens (mostly test)
> one-liners.
>
> That module should be called Stash::Alias, not HAS.
>
> >   E.g. we have something like
> >
> >   perl -we 'use My::Very::Long::Module; $x =
> My::Very::Long::Module->new( foo => 42 ); print $x->foo;'
> >
> >   I've come up with an interface to shorten that to just
> >
> >   perl -Mnew=x=My::Very::Long::Module,foo,42 -we "print $x->foo;"
> >
> >   It works well under strict, too.
> >
> >   And it looks like it makes some sense - see this Perlmonks discussion:
> http://perlmonks.org/?node_id=1178455
> >
> >   However, I'm still unsure if the fun is worth putting into global
> namespace, and module name HAS to be short, otherwise it kills the idea.
> >
> >   Maybe there's a way to get people to try it out first without
> polluting CPAN if it fails?
> >
> >   Acme::n? github project w/o CPAN release?..
> >
> >   The module itself:
> >
> >   https://gist.github.com/dallaylaen/206a649ea54db4c6db93e99a2e9514b0
> >
> >   Thank you,
> >
> > --
> > Konstantin S. Uvarin
> > jabber: see 
> > skype: kuvarin
> > http://github.com/dallaylaen
>
>


-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan


Re: A funny module that shortens one-liners - is it worth global namespace?

2016-12-27 Thread Reini Urban

> On Dec 27, 2016, at 11:20 AM, Konstantin S. Uvarin  wrote:
> 
> Hello everyone,
> 
>   I've come up with idea or a module that shortens (mostly test) one-liners.

That module should be called Stash::Alias, not HAS.

>   E.g. we have something like
> 
>   perl -we 'use My::Very::Long::Module; $x = My::Very::Long::Module->new( foo 
> => 42 ); print $x->foo;'
> 
>   I've come up with an interface to shorten that to just
> 
>   perl -Mnew=x=My::Very::Long::Module,foo,42 -we "print $x->foo;"
> 
>   It works well under strict, too.
> 
>   And it looks like it makes some sense - see this Perlmonks discussion: 
> http://perlmonks.org/?node_id=1178455
> 
>   However, I'm still unsure if the fun is worth putting into global 
> namespace, and module name HAS to be short, otherwise it kills the idea.
> 
>   Maybe there's a way to get people to try it out first without polluting 
> CPAN if it fails?
> 
>   Acme::n? github project w/o CPAN release?..
> 
>   The module itself:
> 
>   https://gist.github.com/dallaylaen/206a649ea54db4c6db93e99a2e9514b0
> 
>   Thank you,
> 
> --
> Konstantin S. Uvarin
> jabber: see 
> skype: kuvarin
> http://github.com/dallaylaen



signature.asc
Description: Message signed with OpenPGP using GPGMail


A funny module that shortens one-liners - is it worth global namespace?

2016-12-27 Thread Konstantin S. Uvarin
Hello everyone,

  I've come up with idea or a module that shortens (mostly test) one-liners.

  E.g. we have something like

  perl -we 'use My::Very::Long::Module; $x = My::Very::Long::Module->new(
foo => 42 ); print $x->foo;'

  I've come up with an interface to shorten that to just

  perl -Mnew=x=My::Very::Long::Module,foo,42 -we "print $x->foo;"

  It works well under strict, too.

  And it looks like it makes some sense - see this Perlmonks discussion:
http://perlmonks.org/?node_id=1178455

  However, I'm still unsure if the fun is worth putting into global
namespace, and module name HAS to be short, otherwise it kills the idea.

  Maybe there's a way to get people to try it out first without polluting
CPAN if it fails?

  Acme::n? github project w/o CPAN release?..

  The module itself:

  https://gist.github.com/dallaylaen/206a649ea54db4c6db93e99a2e9514b0

  Thank you,

-- 
Konstantin S. Uvarin
jabber: see 
skype: kuvarin
http://github.com/dallaylaen