Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Perl6 thread

Name: Anonymous 2011-01-09 22:35

There are too many ways to do it.

The completely backwards way:

> sub foo(&f) { f() }
{ "hi".say }.&foo();
hi


On the other hand, closures are much nicer now (JavaScript needs this):
> say (1,2,3,4,5).reduce: { $^a + $^b };
15

Note about .reduce: it only supports binary functions.

A note on operators:
Hyperops, eg: (1,2,3,4) «+» (5,6,7,8)
These are permitted to auto-parallelize (implementation dependent.)
Lazy meta-ops, eg: 1,2,3,4 Z+ 5,6,7,8
These support lazy evaluation. The result is generated as needed.
Reduction meta-ops, eg: [+] 1,2,3,4,5
Triangular reduction: [code][\+] 1,2,3,4,5 # result is (1,3,6,10,15)[code]
These are basically .reduce(*[b][i]op[/i][/b]*) with the binary operator provided.

Name: Anonymous 2011-01-18 14:20

>>31

Shit, sorry... i meant



:

Name: Anonymous 2011-01-18 14:26

>>41

Fuck, what's wrong with me

I meant >>36, and I meant the COLON : operator

Name: Anonymous 2011-01-18 15:32

>>42
I'd like to know that too.
It's especially weird since this seems to work fine:

sub testsub (&fun) {fun 1};

testsub &say      # => 1
testsub *.say     # => 1
testsub {$^a + 1} # => 1


So why do functions like map require the colon?

Name: Anonymous 2011-01-18 15:35

>>43
I meant to write testsub {say $^a} for the last one

Name: V15170R 2011-01-18 16:12

Here:

my $a = 5; my $b := $a; $b = 9; say $a;

That prints

9

:= binds $a and $b

Name: Anonymous 2011-01-18 16:15

>>43
They don't. It just saves you writing the parens.

@a.push(5) can be written as @a.push: 5

Name: V15170R 2011-01-18 16:17

From the IRC...

my @a; @a.push: 5 is the same as @a.push(5)

Name: Anonymous 2011-01-18 16:17

>>46,47

lol

Name: Anonymous 2011-01-18 16:19

>>46,47
There are n + 1 ways to do it.

Name: Anonymous 2011-01-18 16:20

These are this little things you like once you learn about them. It's nothing serious, it just looks pretty

Name: Anonymous 2011-01-18 16:22

>>46
Why can't you write it as @a.push 5 for methods like for normal functions?

In ruby for instance that works: [1,2,3].push 4

Name: Anonymous 2011-01-18 16:30

>>51
That'll result in something called TTIAR: Two terms in a row, forbidden by the standard grammar. But don't ask me about the rationale, I don't remember

Name: Anonymous 2011-01-18 16:38

>>52
What exactly is a term? I assume 'say' in 'say "foo"' is not a term then?

Name: Anonymous 2011-01-18 16:52

Name: Anonymous 2011-01-18 18:06

damn, perl6 is so cool.... we use a lot the Mod 11 Check Digit algorithm in my country for calculating the rut (the unique identifier for people in Chile)... now here is on one line!!!!!


my $rut = "1234567"; my $checksum = (0 .. 9,'K', 0)[ 11 - ( [+] $rut.split('').reverse <<*>> (2..7) ) % 11 ]; say $rut~'-'~$checksum;


Sauce:
http://en.wikipedia.org/wiki/MSI_Barcode#Mod_11_Check_Digit

Wanna test with other numbers?
http://joaquinnunez.cl/jQueryRutPlugin/generador-de-ruts-chilenos-validos.html

It has a bug, though. Does not work with, for example, "1", which should return "1-9". For real life applications is not important (such small rut numbers does not exists those days), but it's still a shortcoming.

Name: Anonymous 2011-01-18 19:03

APL is just a bunch of Perl 6 operators.

Name: Anonymous 2011-01-19 0:18

>>36
Are you talking about the colon, the ellipses, or $^a and the like?

The ^ is a secondary sigil (they call 'em 'twigils') which indicates the variable should be bound from arguments in roughly alphabetic order. So $^a gets the first argument, $^b gets the second and so on. They also serve to construct the signature:

{ $^a + $^b }.signature.perl.say
:(;; Mu $a, Mu $b)

... can be the sequence operator:
@a := 1, 4, 9 ... *; @a[5].say
16
Or yadda-yadda-yadda:
for ^10 { if $_ > 5 { ... } else { say "5 or less" } }

5 or less
5 or less
5 or less
5 or less
5 or less
5 or less


for ^10 { if $_ > 5 { ??? } else { say "5 or less" } }

5 or less
5 or less
5 or less
5 or less
5 or less
5 or less
Stub code executed


for ^10 { if $_ > 5 { !!! } else { say "5 or less" } }

5 or less
5 or less
5 or less
5 or less
5 or less
5 or less
Stub code executed


I don't think this behavior is quite spec, but IIRC ... is more or less silent, ??? is a warning, !!! is a die/exception.

The := in the sequence example is just variable binding (in this case, binding @a to the list generation instead of assigning the results to @a, which would never terminate normally.) In the reduce: call, the colon is an alternate form of providing arguments to a method call (note: this doesn't work on subs):
say (1,2,3,4,5).reduce: { $^a + $^b };
Is the same as:
say (1,2,3,4,5).reduce({ $^a + $^b });
It alleviates the ugliness of passing inline code as arguments. See also: whatever-star; this would also have worked:
(1,2,3,4,5).reduce(*+*);
Or even:
(1,2,3,4,5).reduce: *+*;

>>40
Yeah, there were some revelations about Perl 5's grammar at one point. It had to do with the semantics of the statement being relevant before it could be parsed.

>>51
You can for subs. The rules may seem a bit weird, but it makes sense. Without it, you would have a term (variable) followed by another term (variable) without an operator in between. That is bad for reasons that the grammar can answer. (It's also why grep {...} @list must be grep {...}, @list in Perl 6. Though you'd usually use a list expression, or the .grep method instead.

>>53
Generally speaking, I believe it is things that can be operated upon. Operators don't count (except when they do.)

Name: Anonymous 2011-01-19 0:36

>>55
my $rut = "1"; my $checksum = (0 .. 9,'K', 0)[ 11 - ( [+] $rut.split('').reverse >>*>> (2..7) ) % 11 ]; say $rut~'-'~$checksum;
IIUC that should fix it, but there seems to be a bug in Rakudo that is causing the evaluation to come out wrong for most numbers.

Name: Anonymous 2011-01-19 14:36

Name: Anonymous 2011-01-20 11:49

Name: Anonymous 2011-01-20 13:18

>>59
Shitty article, guy doesn't know Perl.

Name: Anonymous 2011-02-04 13:25

Name: Anonymous 2011-04-11 10:59

This code will show you the truth of Perl6


perl -e 'print "Perl6 has an operator for $_" foreach (qx[cat /usr/dict/words]);'

Name: Anonymous 2013-01-19 14:36

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Name: Anonymous 2013-06-04 9:20

bumping for interesting thread

Name: Anonymous 2013-06-04 9:23

checkem 6's

Name: Anonymous 2013-06-04 13:29

I prefer Perl5. There is no type.

Name: Anonymous 2013-06-04 15:57

>>1
Symta: say: [1 2 3 4 5] fold: A B => A+B

Perl:  say (1,2,3,4,5).reduce: { $^a + $^b };

Name: Anonymous 2013-06-04 15:59

Perl: https://github.com/perl6/std/blob/master/STD.pm6

Symta:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;; READER

(defparameter  /base   nil)   ; beginning of input stream
(defparameter  /in     nil)   ; current position inside input
(defparameter  /src    nil)   ; source, from where input comes
(defparameter  /res    nil)   ; result
(defparameter  /row    nil)   ; current row
(defparameter  /col    nil)   ; current column
(defparameter  /off    nil)   ; current offset inside input
(defparameter  /last   nil)   ; last processed char

(to /error msg ! error "{/src}:{/row},{/col}: {msg}")

(to /top-char ! car /in)

(to /next-char
  ! c = (/top-char)
  ! if eq c #\newline
  ! ! do (setf /col 0)
         (incf /row)
  ! ! incf /col
  ! incf /off
  ! setf /last c
  ! setf /in (cdr /in)
  ! c)

(to /skip-ws
  ! c = (/top-char)
  ! cond
  ! ! find c '(#\space #\newline)
  ! ! ! (/next-char)
  ! ! ! (/skip-ws)
  ! ! and (eq c #\/) (eq (second /in) #\/)
  ! ! ! (/next-char)
  ! ! ! (/next-char)
  ! ! ! while and (/top-char) (not (eq (/top-char) #\newline))
  ! ! ! ! (/next-char)
  ! ! ! (/skip-ws)
  ! ! and (eq c #\/) (eq (second /in) #\*)
  ! ! ! (/next-char)
  ! ! ! (/next-char)
  ! ! ! o = 1
  ! ! ! while plusp o
  ! ! ! ! unless /in
  ! ! ! ! ! /error "`/*`: missing `*/`"
  ! ! ! ! a = (/next-char)
  ! ! ! ! b = first /in
  ! ! ! ! cond
  ! ! ! ! ! and (eql a #\*) (eql b #\/) :> (! (/next-char) ! decf o)
  ! ! ! ! ! and (eql a #\/) (eql b #\*) :> (! (/next-char) ! incf o)
  ! ! ! (/skip-ws)
  )

(to /take-prefix p
  ! rec r ys nil
  ! ! y = (/top-char)
  ! ! if funcall p y
  ! ! ! r (cons (/next-char) ys)
  ! ! ! nreverse ys)

(to /location match
  ! l = length match
  ! list
  ! ! list "Col" (- /col l)
  ! ! list "Off" (- /off l)
  ! ! list "Row" /row
  ! ! list "Src" /src)

(to /expect c
  ! if eq (/top-char) c
  ! ! (/next-char)
  ! ! /error "Expected `{c}`; Got `{or (/top-char) 'EOF}`")

(defmacro try ((var expr fail) &body body)
  `(! ,var = ,expr
    ! if eq ,var :fail
    ! ! ,fail
    ! ! do ,@body))

(to str-empty? o ! and (quote? o) (equal (second o) ""))

(to interp l e r ; interpolate expression into string
  ! l = (! if str-empty? l
         ! ! list "\"" e
         ! ! list "\"" l e)
  ! unless str-empty? r
  ! ! setf l (! if headed "\"" r
              ! ! q ''l ''(cdr r)
              ! ! q ''l ''(list r))
  ! l)

(to /read-string ic d s e
  ! l = nil
  ! while t
  ! ! c = (/top-char)
  ! ! unless eq c ic :> (/next-char)
  ! ! cond
  ! ! ! eq c #\\
  ! ! ! ! setf c (/next-char)
  ! ! ! ! cond
  ! ! ! ! ! eq c #\n :> push #\newline l
  ! ! ! ! ! eq c #\t :> push #\tab l
  ! ! ! ! ! eq c #\\ :> push #\\ l
  ! ! ! ! ! or (eq c #\n) (eq c ic) (eq c e) (eq c s) :> push c l
  ! ! ! ! ! eq c nil :> /error "EOF in string"
  ! ! ! ! ! or t :> /error "Invalid escape code: {c}"
  ! ! ! eq c s
  ! ! ! ! incf d
  ! ! ! ! push c l
  ! ! ! eq c e
  ! ! ! ! decf d
  ! ! ! ! if < d 0
  ! ! ! ! ! return-from /read-string (list "\\" (coerce (reverse l) 'string))
  ! ! ! ! ! push c l
  ! ! ! eq c ic ;interpolate
  ! ! ! ! try it (/term) (/error "`[`: missing argument")
  ! ! ! ! ! r = /read-string ic d s e
  ! ! ! ! ! return-from /read-string (interp (list "\\" (coerce (reverse l) 'string)) (cdr it) r)
  ! ! ! eq c nil :> /error "EOF in string"
  ! ! ! or t :> push c l
  )

(to /string
  ! case (/top-char)
  ! ! #\" (/next-char) (/read-string #[ 0 nil #\")
  ! ! #\' (/next-char) (/read-string #[ 0 nil #\')
  ! ! #\` (second (/read-string nil 0 nil (/next-char)))
  ! ! otherwise :fail)

(to /list &key r-op
  ! opening = (/top-char)
  ! op = (or r-op
             (find-if (fn (x) (eq (char x 0) opening))
                      '("()" "[]"))
             (return-from /list (/string)))
  ! ending = aref op 1
  ! row = nil
  ! col = nil
  ! setf row /row
  ! setf col /col
  ! unless r-op :> /expect opening
  ! rec r xs nil
  ! ! try x (/expr) (! if eq (/top-char) ending
                     ! ! (/next-char)
                     ! ! error "{/src}:{row},{col}: unclosed `{opening}`"
                     ;;! (meta-set (ns-set nil "Src" (/location nil)) xs)
                     ! xs = nreverse xs
                     ! when string= op "[]" :> setf xs (q "list" ''xs)
                     ! xs)
  ! ! ! r (cons x xs)
  )

(to hex-digit? x ! or (digit? x) (find x "abcdefABCDEF"))

(to /num
  ! cond
  ! ! digit? (/top-char)
  ! ! ! rec r i t
              ys nil
  ! ! ! ! y = (/top-char)
  ! ! ! ! cond
  ! ! ! ! ! and (eql y #\.) i (digit? (second /in)) :> r nil (cons (/next-char) ys)
  ! ! ! ! ! digit? y :> r i (cons (/next-char) ys)
  ! ! ! ! ! or t :> read-from-string (coerce (nreverse ys) 'string)
  ! ! eq (/top-char) #\#
  ! ! ! /expect #\#
  ! ! ! when eq (/top-char) #\{ :> return-from /num (list "#" (second (/list)))
  ! ! ! when /sym-body? (/top-char)
  ! ! ! ! s = coerce (/take-prefix #'/sym-body?) 'string
  ! ! ! ! when hex-digit? (aref s 0) :> return-from /num (read-from-string (concatenate 'string "#x" s))
  ! ! ! ! when string= s "yes" :> return-from /num :yes
  ! ! ! ! when string= s "no" :> return-from /num :no
  ! ! ! ! when string= s "void" :> return-from /num :void
  ! ! ! ! when string= s "head" :> return-from /num :head
  ! ! ! ! /error "`#{s}` is unexpected"
  ! ! ! /error "`#{(/top-char)}` is unexpected"
  ! ! or t :> :fail)

(to /delim
  ! (/skip-ws)
  ! c = assoc (/top-char) '((#\| :|\||) (#\: :|:|) (#\; :|;|))
  ! unless c :> return-from /delim (/list)
  ! (/next-char)
  ! second c)

(to /term
  ! (/skip-ws)
  ! x = (/top-char)
  ! if /sym-head? x
  ! ! coerce (/take-prefix #'/sym-body?) 'string
  ! ! try n (/num) (/delim)
  ! ! ! when /sym-head? (/top-char)
  ! ! ! ! setf n (list "*" n (/dot))
  ! ! ! n)

(defun left-curly () "{")
(defun curly-braces () "{}")

(to delim? x ! find x '(:|\|| :|:| "=" "=>") :test 'equal)

(to /op &rest ops
  ! (/skip-ws)
  ! c = (/top-char)
  ! when or (alpha? c) (digit? c) (not (find c ops))
  ! ! return-from /op :fail
  ! string (/next-char))

(defmacro /lop (name down &rest ops) ; left-biased op
  `(to ,name
     ! try a (,down) :fail
     ! ! rec r e a
     ! ! ! try o (/op ,@ops) e
     ! ! ! ! if string= o (left-curly)
     ! ! ! ! ! do
     ! ! ! ! ! ! xs = /list :r-op (curly-braces)
     ! ! ! ! ! ! when find-if #'delim? xs :> setf xs (list xs)
     ! ! ! ! ! ! r (q '(curly-braces) 'e ''xs)
     ! ! ! ! ! try b (,down) (/error "`{o}`: missing right operand")
     ! ! ! ! ! ! r (list o e b)))

(defmacro /rop (name down &rest ops) ; right-biased op
  `(to ,name
     ! try a (,down) :fail
     ! ! try o (/op ,@ops) a
     ! ! ! try b (,name) (/error "`{o}`: missing right operand")
     ! ! ! ! list o a b))


(defmacro /prop (name down &rest ops) ; prefix op
  `(to ,name
     ! try o (/op ,@ops) (,down)
     ! ! try a (,name) (/error "`{o}`: missing operand")
     ! ! ! if and (numberp a) (equal o "~") ;dangerous hack
     ! ! ! ! - a
     ! ! ! ! list o a))

(/prop /gs   /term #\^)
(/lop  /dot  /gs   #\. #\, #\{)
(/prop /pref /dot  #\~ #\\ #\$ #\! #\@ #\&)
(/lop  /mul  /pref #\* #\/ #\%)
(/lop  /add  /mul  #\+ #\-)

(to /expr ! (/add))

(to /line
  ! rec r xs nil
  ! ! try x (/expr) (! if-bind it (/top-char) (/error "Unexpected `{it}`")
                     ! nreverse xs)
  ! ! ! push x xs
  ! ! ! (/skip-ws)
  ! ! ! if and (eq /last #\newline) (not (eq (/top-char) #\|))
  ! ! ! ! nreverse xs
  ! ! ! ! r xs)

(to head-args? xs ! headed :head xs)
(to head-args-as-list xs ! if (headed :head xs) (cdr xs) xs)
(to list-as-head-args &rest xs ! q :head ''xs)

(to sioc xs ; processes symta indentation of code
  ! unless listp xs :> return-from sioc xs
  ! p = position-if #'delim? xs
  ! unless p
  ! ! unless headed :|\|| xs :> setf xs (mapcar #'sioc xs)
  ! ! return-from sioc xs
  ! text = elt xs p
  ! pref = subseq xs 0 p
  ! xs = subseq xs p (length xs)
  ! body = cdr xs
  ! zs = nil
  ! when equal text "=>" :> return-from sioc (sioc `("to" ,@pref :|:| ,@body))
  ! when equal text "=" :> return-from sioc (sioc `("my" ,@pref :|:| ,@body))
  ! when equal text :|:|
  ! ! pref = or pref '(:void)
  ! ! return-from sioc (sioc (q '(car pref) (:head ''(cdr pref)) '(sioc body)))
  ! while xs
  ! ! pop xs
  ! ! ys = nil
  ! ! while equal (car xs) :|\|| :> push (pop xs) ys
  ! ! while and xs (not (equal (car xs) :|\||)) :> push (pop xs) ys
  ! ! ys = nreverse ys
  ! ! if equal (car ys) :|\||
  ! ! ! push (append (pop zs) ys) zs
  ! ! ! push ys zs
  ! xs = map xs (nreverse zs) :> sioc xs
  ! if pref
  ! ! q '(car pref) (:head ''(cdr pref)) ''xs
  ! ! q do ''xs)

(to /read-toplevel xs src
  ! unless listp xs :> setf xs (coerce xs 'list)
  ! /src = src
  ! /base = xs
  ! /in = /base
  ! /off = 0
  ! /row = 0
  ! /col = 0
  ! /last = nil
  ! r = nil
  ! while /in
  ! ! l = (/line)
  ! ! when xs? l :> push (sioc l) r
  ! nreverse r)

(to /read xs ! first (/read-toplevel xs "<REPL>"))

Name: Anonymous 2013-06-04 16:14

>>69
You've managed to make a language uglier than Perl, congratulations.

Name: Anonymous 2013-06-04 16:17

>>69












               !

              !


  !
  !
  ! !

  ! !
  !
  !
  !
  !


  !
  !
  ! !
  ! ! !
  ! ! !
  ! !
  ! ! !
  ! ! !
  ! ! !
  ! ! ! !
  ! ! !
  ! !
  ! ! !
  ! ! !
  ! ! !
  ! ! !
  ! ! ! !
  ! ! ! ! !
  ! ! ! !
  ! ! ! !
  ! ! ! !
  ! ! ! ! !                                 !              !
  ! ! ! ! !                                 !              !
  ! ! !



  !
  ! !
  ! !
  ! ! !
  ! ! !


  !
  !
  ! !
  ! !
  ! !
  ! !


  !
  ! !
  ! !


    !
    !
    ! !
    ! !

                 !


  !      !
         ! !
         ! !
  !
  ! !         !
              ! !
              ! !
  !


  !
  !
  ! !
  ! !
  ! !
  ! ! !
  ! ! ! !
  ! ! ! !
  ! ! ! ! !
  ! ! ! ! !
  ! ! ! ! !
  ! ! ! ! !
  ! ! ! ! !
  ! ! ! ! !
  ! ! !
  ! ! ! !
  ! ! ! !
  ! ! !
  ! ! ! !
  ! ! ! !
  ! ! ! ! !
  ! ! ! ! !
  ! ! !
  ! ! ! !
  ! ! ! ! !
  ! ! ! ! !
  ! ! !
  ! ! !



  !
  ! !
  ! !
  ! !
  ! !


  !
  !



  !
  !
  !
  !
  !
  !
  !
  ! !                !
                     ! !
                     ! !
                       !
                     !
                     !
                     !
  ! ! !


                 !


  !
  ! !
  ! ! !

  ! ! ! !
  ! ! ! !
  ! ! ! ! !
  ! ! ! ! !
  ! ! ! ! !
  ! !
  ! ! !
  ! ! !
  ! ! !
  ! ! ! !
  ! ! ! !
  ! ! ! !
  ! ! ! !
  ! ! ! !
  ! ! ! !
  ! ! ! !
  ! ! !
  ! !


  !
  !
  !
  !
  !


  !
  !
  !
  ! !
  ! !
  ! ! !
  ! ! ! !
  ! ! !




             !


  !
  !
  !
  ! !
  !



     !
     ! !
     ! ! !
     ! ! ! !
     ! ! ! ! !
     ! ! ! ! ! !
     ! ! ! ! ! !
     ! ! ! ! ! !
     ! ! ! ! !
     ! ! ! ! ! !



     !
     ! !
     ! ! !
     ! ! ! !




     !
     ! !
     ! ! !
     ! ! ! !
     ! ! ! !



                                 !



          !


  !
  ! !                !
                     !
  ! ! !
  ! ! !
  ! ! !
  ! ! ! !
  ! ! ! !

                  !
                         !
                               !


  !
  !
  !
  ! !
  ! !
  !
  !
  !
  !
  !
  !
  !
  !
  ! !
  ! !
  !
  ! !
  ! !
  ! !
  ! !
  ! !
  ! !
  ! ! !
  ! ! !
  !
  !
  ! !
  ! !


  !
  !
  !
  !
  !
  !
  !
  !
  !
  !
  ! !
  ! !
  !

             !

Name: Anonymous 2013-06-04 16:23

I still don't understand the purpose of the fucking !s, Jew. Must be a Jew thing.

Shalom, Nikita!

Name: Anonymous 2013-06-04 16:26

>>70>>71>>72

This talk is about why Perl 5 sucks (although Perl 6 became arguably worser, just it's grammar file is about 6500 lines: https://github.com/perl6/std/blob/master/STD.pm6).
- Abominable syntax: Perl's syntax is so non-orthogonal and hideous, it shades all other Perl warts (which are ugly). Perl's grammar isn't context free and can not be reduced to BNF. Perl's parser (perly.y) is 760 lines long (larger than C++ and Haskell), while the lexer (toke.c) is 11000 lines long, which gives a clue how many kludges Perl needs that the parser can't handle itself. Perl grammar is inherently ambiguous, and the resolved by using dodgy look-ahead heuristics. For example, is "print $f +$g" writing the positive value $g to the file $f, or printing ($f+$g) to STDOUT? Does `{ local $a => 1; ... "` start a scope block or a hash? Other example `f / 25 ; # / ; die "oops!";` can parse two different ways: if `f` takes no arguments, then first statement is a division in void context, and the rest of the line is a comment, otherwise it parses as a call to f() with the result of a match operator, then a call to die(). In general, Perl cannot be parsed, because Perl's syntax is undecidable: http://www.perlmonks.org/?node_id=663393
- Broken scoping: Perl doesn't require variables to be declared and just referencing a name introduces a variable, resulting into cluttered global scope and absence of undefined-variable warnings. Although Perl has my and local keywords, they are not enforced, so nobody uses them. All variables have to be prefixed with ugly $ @ % & sigils all time, just to disambiguate in case variable doesn't already hold a value. It is typical to see crazy code, like "my $fh = do {local(*FH);};", which creates a local typeglob named FH and immediately takes it out of scope, returning the now anonymous typeglob. Perl's broken scoping is a fundamental flaw, which cannot be fixed.
- Inconsistent type system: Perl implicitly coerces strings to integers, so "123abc"=="123def" and "  123xyz"==123, and even 0.0=="". Sigils everywhere make type system depend on scoping. No OOP encapsulation or overloading: Perl has a mess of unorganized global functions. Most typing mismatches, instead of generating error, return some nonsense value, so void+123 or @x+%y==0 would give you untraceable bug. Finally, Perl has no booleans, so there is no way to discern 0 from false; moreover "" and "0" are false too, but "00" isn't, despite "0"=="00". For some reason void acts as true, but referencing undefined variable returns false. Integers are represented as floating point values, so 99999999999999999999==100000000000000000000.
- Perl is hard to learn, due to non-orthogonality by design: Perl's goal of bundling basic Unix utilities into one language was achieved in haste, ending up producing numerous sublanguages loosely glued together, making Perl look like a deficient Unix clone, where all commands are builtins. Perl implements a lot of standard library on syntax level, making language enormous in size: for example, instead of being a library function, regular expressions are implemented as syntactic construct, allowed at unexpected places, like in "print if /regex/", which also gives no clue what it prints or takes as input. Or take "pos($x) = pos($x)", which does bizarre magic at resetting regex. Other example is ".." operator: "print 1..3" produces a sequence, but "print if 1..3" interpret 1..3 as a range of input lines. Then Perl has a lot of duplication: for example, Perl has `not` operator, but for some reason also includes `!` and `unless`, while keyword `if` is overloaded as infix operator, and don't forger about cryptic if?then:else operator. Having a myriad of these special cases, Perl rejects logic and appeals to humanities and theology students, who love learning random facts by rote memorization, and for whom $_ and <> are perfectly clear, even intuitive. The standard Perl documentation contains over 70,000 lines, add to that all the documentation on CPAN modules, and you face a pretty substantial base of prose just to begin with Perl. "Perl users were unable to write programs more accurately than those using a language designed by chance." -- http://ecs.victoria.ac.nz/twiki/pub/Events/PLATEAU/Program/plateau2011-stefik.pdf
- Perl is inefficient: broken scoping impedes efficient compilation and bad type system hinders any optimization, making Perl agonizingly slow. Aggravating Perl's condition are naive reference counting garbage collector and unparsable syntax, requiring solving halting problem just to parse a Perl source file.
- Perl code is unmaintainable, "clever", unreadable and obfuscated: Perl encourages packing unrelated concepts into a messy one-liner, impeding understanding and modification; TIMTOWTDI-redundancy guarantees style discrepancies, misunderstanding and pointless flame-wars among developers, which is aggravated by the size of the language. Finally, Perl isn't modular: it is common to see Perl script 6000 lines long.

Name: Anonymous 2013-06-04 16:26

! ! Shalom!

Name: Anonymous 2013-06-04 16:29

! ! molahS

Name: Anonymous 2013-06-04 16:31

>>75
Valid Symta code

Name: Anonymous 2013-06-04 16:38

>>72
CP payload, silly.

Name: Anonymous 2013-06-04 17:06

>>6
http://perlcabal.org/syn/S03.html
cabal

http://en.wikipedia.org/wiki/Cabal
The term cabal derives from Cabala (a word that has numerous spelling variations), the Jewish mystical interpretation of the Hebrew scripture.
Shalom, Hymie!

Perl is now officially Jewish. And Larry Wall is a crazy kike, obsessed with Bible and Apocalypsis.

Name: Anonymous 2013-06-04 17:23

>>31
Symta (works, because lowercase symbols are literal string):
A = "abcdef";
B = A map: a => z
say A // abcdef
say B // zbcdef


Perl6:
my $a = "abcdef";
my $b = $a.map: { ~~ s/a/z/; $_ }
say $a; # abcdef
say $b; # zbcdef

Name: Anonymous 2013-06-04 17:25

>>79
A = "abcdef";
And I forget to remove the `;`

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List