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

Pages: 1-4041-

Pearls

Name: Anonymous 2011-05-17 17:10

I was told Perl was some complicated masterful thing that was hard to learn and puts python to shame

easier then basic to learn and exact same functionality... am i missing something

Name: Phoenix Wright 2011-05-17 18:03

Objection!

Name: Anonymous 2011-05-17 22:32

>>1
Learn Ruby instead.

Name: Anonymous 2011-05-17 22:45

So, summer in /prog/ is Ruby, Perl, Python, Java, Lisp-haters, C and /g/?

Oh well, see you after summer.

Name: Anonymous 2011-05-17 22:52

>>1
You were misinformed.  Python is much better for most scripting tasks than Perl.

On the other hand, Ruby is DWIM-er than either Python or Ruby, but not nearly as readable.

In short, there is no task for which Perl is a better choice than both Ruby and Python, so it's not really worth your time.

Name: Anonymous 2011-05-17 23:35

>>1
Perl, Ruby and Python are different way to say the same thing.

Name: Anonymous 2011-05-17 23:45

Perl is already dead. Hope Ruby and Python will join him soon. All these lowly nigger-languages deserve only death.

Name: Anonymous 2011-05-17 23:47

>>7
Of course I've no hope seeing PHP dead. Together with C/C++ and JAVA, PHP is a fucking COBOL of 21c.

Name: Anonymous 2011-05-17 23:56

I hope Perl doesn't die.  I love unless and being able to tack on if as a predicate.  It makes my man pussy wet.

Name: Anonymous 2011-05-18 5:15

>>4
What's wrong with Perl and C?

Name: Anonymous 2011-05-18 7:22

>>10
What's wrong with Perl
Perl vs $anything threads.
and C?
C.

Name: Anonymous 2011-05-18 8:09

>>11
very funny. go fuck a goat.

Name: Anonymous 2011-05-18 8:49

>>10
What's wrong with Perl
Sigils.

Name: Anonymous 2011-05-18 10:09

>>9
Haha, what? You can use if as a predicate for if?

Name: Anonymous 2011-05-18 20:26

In Lisp, this sets the variable a to a list:

(setq a '(1 2 3 4))

Here we create list b where the first element is another list:

(setq b '((0.8 0.9 1) 2 3 4))

Here's the first list in Perl:

@a=(1,2,3,4);

and here's the second:

@b=((0.8,0.9,1),2,3,4);

(The @s before the variable names tells Perl that these are array variables.) That wasn't so bad, was it? Well, let's try to use this.

To pick out the first element of the first list in Lisp, you just write

(first a)

and Lisp gives you

1

To get the first element of the second list you write

(first b)

and Lisp gives you

(0.8 0.9 1)

Let's try this in Perl.

$a[0]

gives us

1

The $ before the variable name tells Perl that we want a single value (scalar in Perl lingo), not an array. The [0] tells Perl that we want the first value of the array. Perl, like many other languages and APIs counts from 0.

Then we do

$b[0]

and Perl happily gives us

0.8

That's right, Perl has broken into the list inside the b list and retrieved the first value of it. Or, rather, it flattened b into one list when we created it, so it's now really one consecutive list with 6 elements.

Name: Anonymous 2011-05-18 20:30

>>15
To do this right we should have written

@b=([(0.8,0.9,1)],2,3,4);

when we created the list. The []s enter a reference to the inner list as the first element of the outer list instead of flattening the inner list into the outer one.

OK. So we try again:

$b[0]

gives us

ARRAY(0xb75eb0)

So obviously we manage to find the array, but something still goes wrong along the way. The problem is that we use $b, which makes Perl think that we want a scalar and so it gives us a reference to the array instead of the array itself (which is not a scalar).

Aha! Of course! We must use

@b[0]

because @ tells Perl we want an array value. Not so. We get

ARRAY(0xb75eb0)

once again. I've never managed to understand why this is so and at this point I gave up on the entire thing.

Some weeks later I saw a helpful posting on no.perl: one should request a reference to the array, like this

@{$b[0]}

which actually gives us

(0.8 0.9 1)

So now I can write code with arrays inside arrays and hashes inside hashes.

Now, ask yourself: do you really think you should have to go through all this in order to put one list inside another?

Name: Anonymous 2011-05-18 20:37

>>16
You can only have references in arrays, not other arrays. It's pretty elementary stuff. Now go fuck a goat.

Name: Anonymous 2011-05-18 20:38

>>17
goat
a new o'reilly book?

Name: Anonymous 2011-05-18 20:40

Name: Anonymous 2011-05-18 20:42

>>19
So >>17-san was saying ``go learn Ruby''?

Name: Anonymous 2011-05-18 20:44

puts is a really fucking stupid word. I will never touch Ruby so long as I'd have to use that disgusting piece of shit.

Name: Anonymous 2011-05-18 20:47

>>21
``puts'' is a jewish word for a ``penis''

Name: Anonymous 2011-05-18 20:49

>>22
http://en.wikipedia.org/wiki/List_of_English_words_of_Yiddish_origin
putz: (vulgar) an idiot, a jerk; a penis (from Yiddish פּאָץ pots)

Name: Anonymous 2011-05-18 20:58

>>22
>>23
Matz confirmed for Jewish scumbag. That's what he gets for being a Mormon.

Name: Anonymous 2011-05-18 21:06

>>24
Matz being a Mormon.
Yep. That's a little unusual for a Japanese.

Name: Anonymous 2011-05-18 21:28

>>21

Ruby has puts and print. Take your pick, they both do effectively the same thing.

Also...


var = "Imma let you finish but Ruby Interpolation of strings is fucking badass"
print "But seriously you can #{var} do awesome shit with ruby\n"

Name: Code Less, Create More 2011-05-18 21:35

Lisp

World:'Earth  say "Hello, $World!"


Ruby

var = "Imma let you finish but Ruby Interpolation of strings is fucking badass"
print "But seriously you can #{var} do awesome shit with ruby\n"

Name: Anonymous 2011-05-18 21:49

>>27

There are no parenthesis in that, it is not lisp.

Name: Anonymous 2011-05-18 21:58

c and perl?

TANAMI BROWNE'D

Name: Anonymous 2011-05-18 22:03

>>26
p, puts, and print do different shit.
they're not exactly the same.

Name: Anonymous 2011-05-18 22:04

$var = "Imma let you finish but PHP Interpolation of strings is fucking badass";
print "But seriously you can {$var} do awesome shit with PHP\n";

Name: Anonymous 2011-05-18 22:18

>>28
code-as-data = Lisp

Name: Anonymous 2011-05-18 22:38

>>32
code-as-data = Lisp
Tcl is clearly a Lisp, Io is clearly a Lisp. NO THEY ARE NOT YOU FUCKING RETARD

Name: Anonymous 2011-05-18 22:59

Congrats, retards. You just realized that all of your fancy scripting languages are just copies of each other with slight differences in syntax.

Name: Anonymous 2011-05-18 23:01

>>34
Congratulations, you've just restated what >>6 said, without saging, without giving an actual contribution to the discussion, being a cock-loving faggot.

Name: Anonymous 2011-05-18 23:04

>>33
But TCL doesnt have macros!

Name: Anonymous 2011-05-18 23:04

Congrats, retards. You just realized that all of your fancy scripting languages are just copies of each other with slight differences in syntax.

it deeply upsets me how hardly anyone can see this

Name: Anonymous 2011-05-18 23:23

Lisp and Java are one and the same.

Name: Anonymous 2011-05-18 23:30

>>36
Macros do not imply homoiconicity.

Name: Anonymous 2011-05-18 23:37

>>39
Without code as lists, you cant have macros.

Name: Anonymous 2011-05-19 0:22

>>40
I can have a Lisp with only vectors.

Name: Anonymous 2011-05-19 1:27

>>41
As long as you don't have syntax-objects, you should be ok.

Name: Anonymous 2011-05-19 1:29

>>42
I can have a Lisp with only syntax-objects.

Name: Anonymous 2011-05-19 1:51

>>43
Then you deserve to die, dildomason-jewshiteater.

Name: Anonymous 2011-05-19 1:56

>>44
Stop making Lispers look bad.

Name: Anonymous 2011-05-19 2:02

>>45
Stop betraying pure conses!

Name: Anonymous 2011-05-19 2:05

>>46
I thought you liked Clojure.

Name: Anonymous 2011-05-19 2:18

>>47
The only alive Lisp nowadays is Common one.
schemes, rackets and clojures are unforgivable DERAIL.

Name: Anonymous 2011-05-19 2:38

>>48
I may be a CL user, but I don't see how the other ones are not alive. If a language has healthy and well-maintained implementations, it can be considered alive, and those that you mention do fit the criteria.

Name: Anonymous 2011-05-19 4:18

>>48
You're calling Clojure a Lisp but you also said it must have conses.

Name: Anonymous 2011-05-19 4:38

>>49>>50
They are alive but they are not really lisps. Derailed shit.
BTW maybe u confusing me with someone.
My third post at this board.

Name: Anonymous 2011-05-19 4:42

>>51
Right, you said Lisp and not LISP.

Then, read your SICP or just fuck off already, we've got enough shit to deal for now.

Name: Anonymous 2011-05-19 4:52

>>52
Fuck off, lithper ((faggot)).

Name: Anonymous 2011-05-19 6:05

>>53
Fuck off, C; {faggot};

Name: Anonymous 2011-05-19 6:36

>>54
At least I don't need a special IDE to work out the stupidity of my language, faggot.

Name: Anonymous 2011-05-19 7:44

>>55
But you have a compilation time exponentially proportional to the execution time.

Name: Anonymous 2011-05-19 7:44

>>56
s/ a//

Name: Anonymous 2011-05-19 21:35

http://en.wikipedia.org/wiki/Static_typing
A programming language is said to use static typing when type checking is performed during compile-time as opposed to run-time. Statically typed languages include C++, Haskell, Java, Perl (with respect to distinguishing scalars, arrays, hashes and subroutines)

Name: Anonymous 2011-05-19 22:10

>>58
CL is static typed, it distinguishes functions and variables.

Name: Anonymous 2011-05-19 22:52

>>59
It is called strong typing, not "static typing"

Name: Anonymous 2011-05-19 22:58

>>60
(setq f (lambda (x) x))
(f 3)


No.

Name: Anonymous 2011-05-19 23:46

>>61
He said CL nubface.

Name: Anonymous 2011-05-19 23:46

>>61
you're doing it wrong

(setf (symbol-function 'f) (lambda (x) x))
(f 3)

Name: Anonymous 2011-05-20 0:30

>>63
@{$scalar}

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