Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Jako poucno i zabavno

[es] :: Perl :: Jako poucno i zabavno

[ Pregleda: 4788 | Odgovora: 9 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

dwarf
Beograd, Srbija

Član broj: 1328
Poruke: 336
*.f.bg.ac.yu



Profil

icon Jako poucno i zabavno01.01.2002. u 10:33 - pre 271 meseci
Onako, da vidite kako ide perl6 i, jos bitnije, kako ide parrot. Ima par dobrih fora na koje sam se sit ismejao... :))))

http://www.panix.com/~ziggy/parrot.html#id335812
 
Odgovor na temu

Dragoslav Krunić

Član broj: 225
Poruke: 1083
*.verat.net



Profil

icon Re: Jako poucno i zabavno03.01.2002. u 22:03 - pre 271 meseci
Sve u svemu jedan veoma interesantan dokument kao i ostali na istom sajtu koji se ticu Perla 6. Ovo mi se najvise doapda:

5. Why should I program in Parrot Assembly language?

Lots of reasons, actually. :-)


*All the cool kids are doing it.

*It's a neat hack.

*You get all of the pleasure of programming in Assembly language without any of the requisite system crashes.
 
Odgovor na temu

dwarf
Beograd, Srbija

Član broj: 1328
Poruke: 336
*.yubc.net



Profil

icon Re: Jako poucno i zabavno03.01.2002. u 23:00 - pre 271 meseci
Ne znam, meni se ona fora sa C-om definitivno najvise dojmila... :)))
 
Odgovor na temu

Dragoslav Krunić

Član broj: 225
Poruke: 1083
*.verat.net



Profil

icon Re: Jako poucno i zabavno04.01.2002. u 09:30 - pre 271 meseci
Gledao sam nove stvari koje se uvode u Perlu 6 i primetio sam operator :=
Procitao sam opis pored njega ali mi i dalje nije jasno sta on radi. Pise da on i dalje sluzi za dodeljivanje ali ima jos jednu funkciju. Da li bi neko mogao da mi pojasni?
 
Odgovor na temu

dwarf
Beograd, Srbija

Član broj: 1328
Poruke: 336
*.yubc.net



Profil

icon Re: Jako poucno i zabavno04.01.2002. u 09:52 - pre 271 meseci
Baci gde si to video pa da pogledamo...Verovatno u RFC-ovima...Kojem tacno???
 
Odgovor na temu

Dragoslav Krunić

Član broj: 225
Poruke: 1083
*.verat.net



Profil

icon Re: Jako poucno i zabavno04.01.2002. u 11:03 - pre 271 meseci
Razmatranje operatora nalazi se u dokumentu Apocalypse 3. Prvo sam mislio da je ovaj operator potpuno zamenio operator '=' ali prevario sam se. Operator '=' postoji i dalje. Ovaj novi isto vrsi neku dodelu vrednosti ali izgleda da nije bas tako jednostavno kao u Pascalu na primer. Evo sta tamo pise o tom operatoru:

Binary :=

We need to distinguish two different forms of assignment. The standard assignment operator, =, works just as it does Perl 5, as much as possible. That is, it tries to make it look like a value assignment. This is our cultural heritage.

But we also need an operator that works like assignment but is more definitional. If you're familiar with Prolog, you can think of it as a sort of unification operator (though without the implicit backtracking semantics). In human terms, it treats the left side as a set of formal arguments exactly as if they were in the declaration of a function, and binds a set of arguments on the right hand side as though they were being passed to a function. This is what the new := operator does. More below.
 
Odgovor na temu

dwarf
Beograd, Srbija

Član broj: 1328
Poruke: 336
*.yubc.net



Profil

icon Re: Jako poucno i zabavno04.01.2002. u 13:48 - pre 271 meseci
WTF??? Iskreno, ni meni nije bas najjasnije...Kao da prica o tome da to sluzi da ti prosledjujes argumente f-jama...Mozda neka nova forma closures-a???
 
Odgovor na temu

Dragoslav Krunić

Član broj: 225
Poruke: 1083
*.verat.net



Profil

icon Re: Jako poucno i zabavno04.01.2002. u 14:26 - pre 271 meseci
I ja sam ga razumeo tako nekako i ako sam u dobro razumeo, to je onda mnogo glupa fora. Na istoj stranici, odmah ispod objasnjenja tog operatora, stoji primer u kombinaciji sa drugim operatorima ali tek mi onda nista nije jasno....
 
Odgovor na temu

dwarf
Beograd, Srbija

Član broj: 1328
Poruke: 336
*.yubc.net



Profil

icon Re: Jako poucno i zabavno04.01.2002. u 23:08 - pre 271 meseci
Majku mu, baci taj primer ovde pa da vidimo sta je...Posto ni meni nema nimalo smisla...
 
Odgovor na temu

Dragoslav Krunić

Član broj: 225
Poruke: 1083
*.verat.net



Profil

icon Re: Jako poucno i zabavno04.01.2002. u 23:27 - pre 271 meseci
Primer za to je dat sa kombinacijom * operatora koji je objasnjen odmah ispod:


Unary *

Unary * is the list flattening operator. (See Ruby for prior art.) When used on an rvalue, it turns off function signature matching for the rest of the arguments, so that, for instance:

@args = (\@foo, @bar);
push *@args;

would be equivalent to:

push @foo, @bar;

In this respect, it serves as a replacement for the prototype-disabling &foo(@bar) syntax of Perl 5. That would be translated to:

foo(*@bar)

In an lvalue, the unary * indicates that subsequent array names slurp all the rest of the values. So this would swap two arrays:

(@a, @b) := (@b, @a);

whereas this would assign all the array elements of @c and @d to @a.

(*@a, @b) := (@c, @d);

An ordinary flattening list assignment:

@a = (@b, @c);

is equivalent to:

*@a := (@b, @c);

That's not the same as

@a := *(@b, @c);

which would take the first element of @b as the new definition of @a, and throw away the rest, exactly as if you passed too many arguments to a function. It could optionally be made to blow up at run time. (It can't be made to blow up at compile time, since we don't know how many elements are in @b and @c combined. There could be exactly one element, which is what the left side wants.)
 
Odgovor na temu

[es] :: Perl :: Jako poucno i zabavno

[ Pregleda: 4788 | Odgovora: 9 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.