Shinyshell Community Forums > Coding >
Perl 6


[1]


August 28 02009, 20:08 GMT
SpaceMan
Member

SpaceMan's avatar
Location: Earth
Post count: 32
ca
Perl 6 will be a completely new Perl, it will have all weird and complex features, advanced function parameters and all features of modern programming languages.

Here are some Perl 6 examples
 sub somefunction($a, $b, :$c, :$d, *@e) {...}
 
 somefunction(1, 2, :d<3>, 4, 5, 6); # $a=1, $b=2, $d=3, @e=(4,5,6)
 somefunction(:b<2>, :a<1>);         # $a=1, $b=2
 
sub somefunction($a, $b, :$c, :$d, *@e) {...}

somefunction(1, 2, :d<3>, 4, 5, 6); # $a=1, $b=2, $d=3, @e=(4,5,6)
somefunction(:b<2>, :a<1>); # $a=1, $b=2
]]>


and even looping 2 or more element at one time
 for @points -> $a, $b {
   line($a.x, $a.y, $b.x, $b.y)
 }
 
for @points -> $a, $b {
line($a.x, $a.y, $b.x, $b.y)
}
]]>

Perl 6 also introduces roles, they acts like interfaces
 class Mammal is Vertebrate {...}
 class Dog is Mammal {...}
 role Pet {...}
 role Stray {...}
 role Guide {...}
 
class Mammal is Vertebrate {...}
class Dog is Mammal {...}
role Pet {...}
role Stray {...}
role Guide {...}
]]>

You no longer need () after if
 if $a > 10 {
   say "a > 10"
 }
 
if $a > 10 {
say "a > 10"
}
]]>


The Perl 6 article on Wikipedia: http://en.wikipedia.org/wiki/Perl_6

August 28 02009, 20:19 GMT
Pikachu
Kelp is good!

Pikachu's avatar
Location: California
Post count: 50
us
Oh no, it's Perl! I programmed a bit in Perl, but I didn't really enjoy it much. It's one of the reasons why I switched to Python. That and Python is much cleaner.
______________________________

Linux | Chrome | Python | Chuck

August 28 02009, 21:58 GMT
Kthar
Krme jedno bezglavo

Kthar's avatar
Location: kroatie
Post count: 106
hr
Perl 6, a.k.a. Line noise 6, will contain a number of weird and wonderful features that people will have to spend years learning through a combination of buying thousands of books and meditating under a freezing waterfall daily.

August 29 02009, 00:56 GMT
SpaceMan
Member

SpaceMan's avatar
Location: Earth
Post count: 32
ca
Perl 5 is hard enough, The scalar and list contexts are hard to remember

August 30 02009, 00:33 GMT
Pikachu
Kelp is good!

Pikachu's avatar
Location: California
Post count: 50
us
I think I have forgotten most of my Perl learning. I probably only remember how to do if else statements.
______________________________

Linux | Chrome | Python | Chuck


[1]



Forum Information
  Currently Active Members [detailed] (0 members and ? guests)
-
Forum Statistics
Topics: 0, Posts: 0, Members: 108.
Welcome to our newest member, adamthephantump
Most members online was 5, on August 28 2009, at 21:49:28.
Legend
    Forums with unread topics in them are indicated by a strong yellow colouring around the forum icon.
    Forums with no unread topics have the standard pale yellow colouring around the forum icon.
    Forums with a blue arrow icon will redirect you to a non-forum page.
    Locked forums have a little padlock by their icon. You won't be able to post in these forums.
Shinyshell Home | Contact | Staff List | Archive | Top 

Conventional Login

Don't have an account? You may want to create one.

OpenID Login
OpenID login and registration is usable, but not finished.
What is OpenID?
Search

(advanced search)
Site Stats
  Total members: 108
  Latest member: adamthephantump
  Members currently online: 0
  Most online: 5 - Aug 28, 2009 (21:49)
  Front page hits: 88007
Developer info
  Site version: 3.5 Alpha
  16 queries - 9 templates
Under the Spotlight
Collide Site
Collide make fabulously dreamy electronic-industrial music, they're one of my favourite bands! Give them a chance to take control of your life - myspace | youtube - "Euphoria".

Collide Site - Hits: 4597

5/5 (2) | Rate this site?