Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

LanX's scratchpad

by LanX (Canon)
on Sep 03, 2008 at 12:42 UTC ( #708739=scratchpad: print w/ replies, xml ) Need Help??

Headlines in the monastery

head 1

head 2

head 3

head 4

head 5

head 6

Things I miss in Perl5

In kind of descending order my wish list.

(brainstormed example code is just sketched and not tested)

Function Signatures

sub ($a,$b,$c) { }

optimally with

  • default settings,
  • named args
  • validation

Autoboxing

use method syntax to apply builtins

$string->match(/x/); $aref->grep B{ };

A REPL in core (allowing lexicals)

Seriously it's so much easier to test and experiment in a REPL

Built-in aliasing for lexicals

*a=$b only works with package-vars

A simple "in" operator

~~ is too confusing

if ($a in @a) { }; $a in 1..1000 # but lazy

Gather/Take to create iterators like in Perl6 or like Python generators

Multiple loop variables

for my [$a,$b,$c] (@list) { }

like  while (my ($a,$b,$c) = splice @list,0,3) {} but not destrcutive.

A shorter block syntax

sub to pass lamdas as argument w/o prototype at any position is too long

(approach ruby in brevity)

maybe  func 1,2,3, B{ $a + $b }

A more modular inner structure / documentation

builtins length and special vars could be attributes of a class string

perlfunc is too long!!!

Optional types in declaration

it's already possible to type at declaration my $a int but it's ignored.

This could be used for optimization of inner loops.

Doc-strings

sub bla { doc "this function blas"; return "bla" } print &bla->doc();

Easier introspection in general

seriously playing around with typeglobs and stashes is no fun, a simpler interface could be so easy

%main::->grep B{ /_test$/ and isARRAY }; print map { $_->sig() . "\n" . $_->doc() } grep2 {isCODE} %main::

preview page
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2015-01-28 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (218 votes), past polls