SlideShare a Scribd company logo
1 of 58
Download to read offline
!
" # $ % &
' '
! "
#
$ % & ' (
' '
)
* )))
+ ) " +
+ + , ) " +
+ - . % -
+ / 0 % /
- 1 & 2
- + ) " 1 & 2
- - ) " 3 4
- - + 5 5 4
- - - 5 4
- - / 5 6 "7 8
- / 9 " +:
- ;1 +:
' ( '
/ 9 " & 1 ++
/ + ) " <9 " & 1 ++
/ - 9 " 1 & +-
/ / 9 " 9 +-
/ ;. +-
/ 2 9 " 9 " +;
/ =1 +2
;0 +4
;+ ) " 0 +4
;- 5 3 0 +4
;/ 0 +8
;/ + 1 +>
;/ - . 3 +>
;/ / & -:
;/ ;6 "7 -+
;/ 2 & -+
;/ =1 ( --
;/ 4 . 0 -/
;/ 8 ) ( -;
;; (0 ? -;
;2 "7 0 -2
;=9 " 0 -=
;4 1 7 9 0 -=
2 9 0 ->
2 + ) " 9 0 ->
2 - 990 /:
2 - + /:
2 - - 1 /+
2 - / & 9 " /=
2 - ;1 & % /4
2 / 9 0 /4
2 / + 1 /4
' ( '
2 / - />
2 / / 1 3 ;:
2 ;1 ;-
=1 ;2
=+ 5 . ;2
=- 3 ;=
=/ 5 6 ;=
, ;>
3 " <
" 0 @ "
5 ! " 1 0 A
B 0
(
0 A ! "
0 5
' '
" B
< B
! "
" "
% < 0 @
" ) @ #
3 C , C
! "
"
! "
5 # ! " < 0
@
3 0 D 990
9 0
"
7
) % * + ,-
' '
% =
D "
7
'B " E
! @
' E
"7 "
"7 E
# 0 "7 E
@ "7 0
@ " E
7
! ! " ! # $
% & ! ! $
! # $
' " ( "
!
3
! '
# 8: F '
' @ D
! " ! "7
# >: C
!
@
' . '
G
@ "
5 ( #
@ !
1 @ H I.&
@ C J
0 " # '
" " "
@ "
5 # @ #
' ! @
3
#
"7 ' @ D
• " " # " $
• % " # # " " $
• " # &'" $
• " # " $
• #( # " #)" $
• * " & + " # (
0 B ' @
( '
@ "
) % + ) /
' 0 '
, #
" ' B
# H 9 B
.1 5 C . K )&
" # # 0
0 #
- . .(/"
" '
@ G
B ' '
L @ # H
9 & M 5 H # @ '
# M #
@ H N &
! # ' !
5 H ! "
< @
N M 5 9 ),&
- . 0 "
0 (
0
( #
"
' 1 '
"
#
"
# @
(
- . 1 2
#
"7
L # @ @ "
3 @
(
@ 7 "7
O "7
+ 2 1
' @ D
...
soma = 0;
for (i=1; i<=5; i++)
soma = soma + i;
...
0@ - +
I P D
) % + ) /
' 2 '
sum [1..5]
0@ - -
Q+ 2R G + 2 #
" #
5 #
5 1'
5 1' ! 1 +>/=
' "7
5 1'
# @
# "
@ " @ ' . #
" "
O " #
" O !
"
' "7
O " '
!
' * '
3
5 @ '
" # @
/ ' "
@ "
"
1 ) "
(
"
0 ! #
"7
"
1 # " '
H ' "
) *
$
+! # $ $ # $ %
' " ( "
43 # ! (
5
@ 5
" '
5 #
7
<
'
' * '
3 !
5 @ '
"
" ! B
" " @ " #
"
3 3 #
# @ #
@
5 @
# " @ "
B 3 9
@ # @ "
B
9 3 9
5 *
5 B D
) % + , )
' * '
5 !
@ 0
! G # 5
# # "
0@ D
• " S 0 #
! " "7
# ! # "
"7
E
• 5 ' '& S 0 "
@
7 ' ! "7
7
" "
@
5 D
• 5" S
" # ! B
7 # "
0 "
# ! E
• , & " S 5 ( @
@ " E
• S # @ 7
@ E
' *! '
• 5 2 S L "
E
• 305! S @ #
"
9
@ E
• , 3 S 0 # @
@
# @ G 5
#
3 3
" @ O
D
• . " " B @ #
E
• 5 " 6 B " ! '
E
• S E
• & " S
• 5 S "
"
0 "7 ' (
'
B !
) % + , )
' *3 '
" " "
!
"
6 # ' +::T "
' @ 5 ' "
" "
' @ #
'
, -
" . # " ! % " ! ! ! $
"
0 0
"7
"7
0 B
. , #
8: 0
' *1 '
!
5 ! ! '
" " C
6 "
# ' (
"
0 +>8=
" "7
" ( " "
"
+>84 0 '
K 0
G
0 +>>8 0 " 0 5 9
& 3,& 9
5 - #
0
• " % " S "
" !
E
• , ( S ' " " E
) % ! +
' *2 '
• ( 6 S ! "
! "
E
• # # 7 S
# @
U V ! E
• 5" 6 " S
! E
• # " " # S
< ' E
• &" + 8&"9 8 "
S
0 #
: ( "
5 # ' @
O @
" 0 # #
@ ' B "
0 " B
@ H #
B C
,
0 0 D
U V . # #
' '
L # @ D E #
G
@ W -XE # G
Q+ - / ;2R + '
< " Q- / ;2R
5 0 ' G !
0 ! "9
5 0 ! # '
(
@ " @ W -XY W5
Z X ' 5
' Z - "7 D
desenha (linha) -> ...;
desenha (circulo) -> ...;
desenha (quadrado)->...;
0@ ;+
" ' #
7 @ "7 "7
case (X) of
linha -> ...;
circulo -> ...;
quadrado -> ...
end;
0@ ;-
J #
) % ! +
' * '
1 2
@ #
9 " ;
-;
factorial(0) ->
1;
factorial(N) when N>0 ->
N*factorial(N-1).
0@ ;/
" #
" D
# ;5 # < =9 : 7>
3 "7 G
"7 @ D
calcula_area(L,C) ->
L*C.
calcula_area(L,C,A) ->
L*C*A.
0@ ;;
!
L 0 G
# ' "7
! "
-module(matematica).
-export([factorial/1]).
' '
factorial(0) ->
1;
factorial(N) when N>0 ->
N*factorial(N-1).
0@ ;2
3 " ! (
" % "
L # " @ (
B
-module(contador).
-export([loop/1]).
loop(Valor) ->
receive
incrementa ->
loop(Valor+1);
{From,valor} ->
From!{self(),Valor},
loop(Valor);
stop ->
true;
Outro ->
loop(Valor)
end.
0@ ;=
@ (
) % ! +
' '
" B
@ !
...
Pid = spawn(contador,loop,[0]),
Pid!incrementa,
Pid!incrementa,
Pid!{self(),valor},
receive
{Pid,Valor} ->
Valor
end,
...
0@ ;4
! '
5 #
<
' ! '
!
" # 0
@ "
? #
Z # " @ # "
@ " ' @
' ! '
somar(A,B) -> verifica(catch A + B).
verifica({'EXIT',Why}) -> {erro,Why};
verifica(X) -> X.
0@ ;8
# " @ "7 !
somar(A,B) ->
catch calc_soma(A,B).
calc_soma(A,B) when number(A),number(B) ->
A + B;
calc_soma(A,B) ->
throw({erro,'operandos invalidos'}).
0@ ;>
@ % " 0 & #
L 0 ' '
' C 1
(
' !
" ' '
0 * % A
( 0 # ?
5 0 B
( " @
) % ! +
' 3 '
!
' " ' " !
"7
" 0 #
1 # <
" 1 #
# B " "
"7
# ' @
0
5 0 # @
@ ! "
@
- # 2
& # @ "7 0
L "7 G !
' "7
& " 0 "7
# "
' . '
3 #
"7 ! 0
'@ " @ "
" @
"
#
1 "7
# 9 #
"7 ( D
• " S @
E
• " + S @ "7
E
• # S
"7
L 0 #
? " 2 3 (
)90 ' "
G
"7
@ ( ! " "
# #
B '
) % ! +
' 0 '
5 " # # #
" ' @
"
C
@ "7
0 !
"7
/ * # -
! #% ! - #
0 # 0 % $ 1
' " ( "
5#( 3 #
% 0 @ "
#
3 C , C
0@ < "
0 3 9
9 0 990 C
, C
' '
5 9 0
. # "
5 990 0
@ !'
C
33
3 C , C 0 #
@ B
!
B
3 @ 0
! "
! 3 B
! 7 B
@ <
U < V 0
" @
# "
0@ #
# @
1 G
#
) % 3 +
' * '
G 0 #
@ "7
"7 @
7
C
0
5
@ "7 '
0 ( 7
[ 
. # ! "
@ 990
'
' @ G
# 3 #
"7 ' 9 #
5
@ U V
"
3 !
!' " "7
' '
' U
@ V "7
5 @ 0 #
" 5 3 C , C 7
U
V # G "
"7
0
" C
1 '
' 0
Z
# #
' @ "
, C 7 D
W ! " # $ X D
• C S
! E
• B S E
• D S E
• 9 S "7
Q RE
) % 3 +
' '
• 0 S '
'
3 990 7 !
D
• S
• S
• S
• # S
• S
& 7 ! " @
,)6 @
!" #! !
!
" ' $ %
& U,)6 V @ D
• 9 ;B < S ' U
V E
• = ;0 8B # 8. < S 1 990
"7 @ 0 "
• = ;0 8B # <E
• = ;B # < S N "7 E
• "9 "E; 8. < S N @
"
' ! '
• # E F" ;D < S 1 E
• # E F# ;! < S 1
E
• "; 8 9 < S 1 E
• E ; < S % '
E
• =; < S % <
. # D
• " ;B< S N # E
• # ;B< S N # E
• ;B< S N # E
• ;B< S N # E
• ;B< S N # E
• # ; 8 < B N
6 # ' ,)6 ' @
• C;! 8185< S % '
9 G
' '
# @ @ E
• "9 "EF " F" ;0 8! < S '
E
• + ;0 8 < S ' E
• F ;< S
E
) % 3 +
' 3 '
• F ;- 8 0 < S &
E
• E ;0 < S 0 '
E
• E;0 < S E
• F F ;- < S %
E
• # F ;B 81 < S ! E
• ; #< S % # U
VE
• ;< S %
E
• F ;0 B # 80 3 < S %
@ E
• F F ;0 < S E
• " ;B < S %
!
E
• " F & ;0 <$
• " F & ;0 8 #< S E
• ;B # 8 < S %
E
• ;< S %
E
• ; 8! < S % (%
W XE
• = ;! 8185<$
• = ;B 8! 8185<$
' . '
• = F E;! 8185<$
• = F E;B 8! 8185< S 1
! %
' E
• " ;0 8G =81 - < S E
• E;0 < S E
• ;B # <$
• ; < S 3 @ E
• =9 ;B # < S %
! 3
' @ "7 G
990 "7
• "+; 8H 9 < S % @ B
)$ E
• "C ;B # 80 "C<
• "C ;0 8B # 80 "C< S 1 F
E
• & ;B # 80 "C<
• & ;0 8 B # 8 0 "C< S 1
F '
" E
• F" ;1 B # < S ( E
• = F" ;1 B # 8 < S 0
0 G "7 !
' 0 U V
) % 3 +
' 0 '
# ! #
0 (
" @ O
( #
(
' " !!'
9 '
3 &
9
"7 0
"7 ! < ,)6
"7
#
"
" #
'
#
' 1 '
0@ / # D
• 0@ *"+ UV (
@ #
E
• 1
E
• 1
'
6 "7
! 0 ,)6
!
B < !
5 #
6 ,)6
#
@
G ,)6
!
6 #
5
" # ' @
9 B '
" ' 0 #
) % 3 +
' 2 '
!7 " # '
"
" # '
" ,)6
# ' 'B
' ! )
@ < " !
B
(
B
) 0 # B
,)6 0 "
"7 0 "7 "7
" " ,)6
0 # ! #
0
U
V ( "
Z #
B !
@ "
' ! '
, ! # #
, (
5
"
0 "
% # "
" 0 % '
!
1 % '
% &
# ' ! !
B 1 "
• E ; < S . E
• # ;58 < S %
E
• =; < S % G -" ! & .'"
! # @ & #
E
• "; 8- < S %
B
E
) % 3 +
' !* '
• ( ;B # I8. J< S 1 B (
"7
E
• F# ;! < S % % %
E
• # ;< S % E
• 9 = ;B< S 3 E
• " F ;B8 C 8 8 < S % ( "
/ E
• F# ;B8B # 8! < S % % E
• F# ;B8B # < S 5 @
1
• C;! 8185< S 0@ % E
• = ;! 8185< S 0@ % E
• = F E;! 8185< S 0@ % E
• = ;B8! 8185< S 0@ %
E
• = F E;B8 ! 8 18 5< S 0@ %
E
• + ; 8 E < S 0 #
/ 0
• =9 ;B # < S % E
• F F ;- < S % E
• " ;< S % E
• ; < S 9 ! '
1 #
• F# ;! <
' ! '
• F# ;! 8 C<
• # F ;! <
• F# ;! <
• F ;<
• ;B # 80 <
• 9 ;<
• " "F ;B <
• F" E ;<
• F" E ;B 8 "E <
• F ;- 80 <
• "9 "EF " F" ;0 8! <
"
5 # "
0
(
6 # ! C
! "7 B
,)6 0 !
) % 3 +
' ! '
% B
9 0 # "
5 #
0
2
3 #
. ( 9
5 !
"7 " #
@ ] '
"
. 0 6
@ "7 ( !
" "7 !
5 '
#
' !. '
112 1 2 (
0 6 U
V
C , C
O "
' #
' ( 0
, &"
5 '
990 9 0
5 #
#
5 '
0 990 9 0
@ @ [ 
. 1
5 B
' ! !
H # "
"
) % . + ) -
' !0 '
% 0
' ' 0 ^) ' 60L
B G
"7 " ' &
' 0 #
! #
"7
@ 7 0 990 9 0 (
1 "
(
"
0
( $ #
0
• H I 3 + %
• 9( 6 6 1 4 5 46 * 5
%7
• 1 0 9 % 8 +>>>
• & 3 6 3 2 &
49 1 :% /7 -::+
• 3 9 / + & 2 ; 5
< +>>=
• I M 6 5_, 2 = " 1 +
& 2
• C , C 112 ; 1 2 +>>4
• C , C / 1 112 +>>4
• C , C % / 1
' 3 '
• C , C 2 ; 5 < 1 & $ >
5 +>>>
• 1 2
3
• CCC S 9 0
• CCC P S 9 I P
• CCC C F` FB 9 C , C
• CCC C P S a P # #
• CCC S &

More Related Content

What's hot

Aia partido progressista
Aia partido progressistaAia partido progressista
Aia partido progressistaGiovanni Sandes
 
Nuno Bernardo: Financing Transmedia?
Nuno Bernardo: Financing Transmedia? Nuno Bernardo: Financing Transmedia?
Nuno Bernardo: Financing Transmedia? power to the pixel
 
Arquitetura da Informação em Repositórios Digitais
Arquitetura da Informação em Repositórios DigitaisArquitetura da Informação em Repositórios Digitais
Arquitetura da Informação em Repositórios DigitaisCristiane Mendes
 
Criptosistemas Clásicos
Criptosistemas ClásicosCriptosistemas Clásicos
Criptosistemas ClásicosSamary Páez
 
US Dept of State Question Box Webinar April 2012
US Dept of State Question Box Webinar April 2012US Dept of State Question Box Webinar April 2012
US Dept of State Question Box Webinar April 2012Open Mind
 
The Colbert Report. La satire politique qui réveille l'Amérique
The Colbert Report. La satire politique qui réveille l'AmériqueThe Colbert Report. La satire politique qui réveille l'Amérique
The Colbert Report. La satire politique qui réveille l'AmériqueAntoine Patricot
 
Media sosial mention2011-libre
Media sosial mention2011-libreMedia sosial mention2011-libre
Media sosial mention2011-libreMelur Orkid
 
Trending #Empathy
Trending #Empathy Trending #Empathy
Trending #Empathy smarkyslide
 
Server not ready
Server not readyServer not ready
Server not readyb3randal
 
The Case For Pharmacists As Legal Healthcare Providers
The Case For Pharmacists As Legal Healthcare ProvidersThe Case For Pharmacists As Legal Healthcare Providers
The Case For Pharmacists As Legal Healthcare ProvidersErin L. Albert
 
20090512 Ictdelta V1 R0
20090512 Ictdelta  V1 R020090512 Ictdelta  V1 R0
20090512 Ictdelta V1 R0Martijn Kriens
 
بوكلت الدراسات الإجتماعية للصف الرابع الابتدائى للترم الثانى
بوكلت الدراسات الإجتماعية للصف الرابع الابتدائى للترم الثانى بوكلت الدراسات الإجتماعية للصف الرابع الابتدائى للترم الثانى
بوكلت الدراسات الإجتماعية للصف الرابع الابتدائى للترم الثانى أمنية وجدى
 
Taklimat kssr b.t tahun 2 sk
Taklimat kssr b.t tahun 2 skTaklimat kssr b.t tahun 2 sk
Taklimat kssr b.t tahun 2 skRavin Ravi
 
2018 Asia Business Outlook
2018 Asia Business Outlook2018 Asia Business Outlook
2018 Asia Business OutlookRob Koepp
 

What's hot (20)

Thomafluid (русский)
Thomafluid (русский)Thomafluid (русский)
Thomafluid (русский)
 
Aia partido progressista
Aia partido progressistaAia partido progressista
Aia partido progressista
 
Nuno Bernardo: Financing Transmedia?
Nuno Bernardo: Financing Transmedia? Nuno Bernardo: Financing Transmedia?
Nuno Bernardo: Financing Transmedia?
 
Arquitetura da Informação em Repositórios Digitais
Arquitetura da Informação em Repositórios DigitaisArquitetura da Informação em Repositórios Digitais
Arquitetura da Informação em Repositórios Digitais
 
Criptosistemas Clásicos
Criptosistemas ClásicosCriptosistemas Clásicos
Criptosistemas Clásicos
 
US Dept of State Question Box Webinar April 2012
US Dept of State Question Box Webinar April 2012US Dept of State Question Box Webinar April 2012
US Dept of State Question Box Webinar April 2012
 
Allen
Allen Allen
Allen
 
The Colbert Report. La satire politique qui réveille l'Amérique
The Colbert Report. La satire politique qui réveille l'AmériqueThe Colbert Report. La satire politique qui réveille l'Amérique
The Colbert Report. La satire politique qui réveille l'Amérique
 
Who was william shakespeare ?
Who was william shakespeare ?Who was william shakespeare ?
Who was william shakespeare ?
 
Media sosial mention2011-libre
Media sosial mention2011-libreMedia sosial mention2011-libre
Media sosial mention2011-libre
 
Trending #Empathy
Trending #Empathy Trending #Empathy
Trending #Empathy
 
Tervetuloa - MobileMonday - Jari Tammisto
Tervetuloa - MobileMonday - Jari TammistoTervetuloa - MobileMonday - Jari Tammisto
Tervetuloa - MobileMonday - Jari Tammisto
 
Server not ready
Server not readyServer not ready
Server not ready
 
The Case For Pharmacists As Legal Healthcare Providers
The Case For Pharmacists As Legal Healthcare ProvidersThe Case For Pharmacists As Legal Healthcare Providers
The Case For Pharmacists As Legal Healthcare Providers
 
Arc Flash
Arc FlashArc Flash
Arc Flash
 
20090512 Ictdelta V1 R0
20090512 Ictdelta  V1 R020090512 Ictdelta  V1 R0
20090512 Ictdelta V1 R0
 
بوكلت الدراسات الإجتماعية للصف الرابع الابتدائى للترم الثانى
بوكلت الدراسات الإجتماعية للصف الرابع الابتدائى للترم الثانى بوكلت الدراسات الإجتماعية للصف الرابع الابتدائى للترم الثانى
بوكلت الدراسات الإجتماعية للصف الرابع الابتدائى للترم الثانى
 
Orden de llegada I Ultra Trail Macizo de Ubiña "Güeyos del Diablu" 2014
Orden de llegada I Ultra Trail Macizo de Ubiña "Güeyos del Diablu" 2014Orden de llegada I Ultra Trail Macizo de Ubiña "Güeyos del Diablu" 2014
Orden de llegada I Ultra Trail Macizo de Ubiña "Güeyos del Diablu" 2014
 
Taklimat kssr b.t tahun 2 sk
Taklimat kssr b.t tahun 2 skTaklimat kssr b.t tahun 2 sk
Taklimat kssr b.t tahun 2 sk
 
2018 Asia Business Outlook
2018 Asia Business Outlook2018 Asia Business Outlook
2018 Asia Business Outlook
 

Viewers also liked (9)

Data governance symposium
Data governance symposiumData governance symposium
Data governance symposium
 
германия
германиягермания
германия
 
State of Minnesota IT Innovation Program update
State of Minnesota IT Innovation Program updateState of Minnesota IT Innovation Program update
State of Minnesota IT Innovation Program update
 
Croatia house for sale
Croatia house for saleCroatia house for sale
Croatia house for sale
 
германия1ppt
германия1pptгермания1ppt
германия1ppt
 
Genovesi.looking back
Genovesi.looking backGenovesi.looking back
Genovesi.looking back
 
auger type ice making machine
auger type ice making machineauger type ice making machine
auger type ice making machine
 
San google
San googleSan google
San google
 
State of mn innovation program
State of mn innovation program State of mn innovation program
State of mn innovation program
 

Similar to safer erlang.PDF

Fiestaru07 2003
Fiestaru07 2003Fiestaru07 2003
Fiestaru07 2003rukford1
 
ΠΛΗ31 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 1
ΠΛΗ31 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 1ΠΛΗ31 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 1
ΠΛΗ31 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 1Dimitris Psounis
 
Fichas para trabajar con euros y centimos
Fichas para trabajar con euros y centimosFichas para trabajar con euros y centimos
Fichas para trabajar con euros y centimosVicky Pinero Elices
 
ΠΛΗ20 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 4
ΠΛΗ20 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 4ΠΛΗ20 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 4
ΠΛΗ20 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 4Dimitris Psounis
 
Excel 2007 warm up
Excel 2007 warm upExcel 2007 warm up
Excel 2007 warm upSubeesh Up
 
Essentials of ramadan
Essentials of ramadanEssentials of ramadan
Essentials of ramadanHelmon Chan
 
En essentials of_ramadan
En  essentials of_ramadanEn  essentials of_ramadan
En essentials of_ramadanHelmon Chan
 
Ricardo%20 gondim%20 %20soli%20deo%20gloria
Ricardo%20 gondim%20 %20soli%20deo%20gloriaRicardo%20 gondim%20 %20soli%20deo%20gloria
Ricardo%20 gondim%20 %20soli%20deo%20gloriaDorival Leandro
 
Rapport de Situation #3 Tempête Tropicale Sandy
Rapport de Situation #3 Tempête Tropicale SandyRapport de Situation #3 Tempête Tropicale Sandy
Rapport de Situation #3 Tempête Tropicale Sandylaurentlamothe
 
Historiografía de la educación comie selección
Historiografía de la educación comie selecciónHistoriografía de la educación comie selección
Historiografía de la educación comie selecciónnada
 
Schoolyard compass game
Schoolyard compass gameSchoolyard compass game
Schoolyard compass gameLukas Stritt
 
Dossier Presentación del Albergue El Último Bucardo
Dossier Presentación del Albergue El Último BucardoDossier Presentación del Albergue El Último Bucardo
Dossier Presentación del Albergue El Último BucardoEncarna Palma Andres
 
iMotions White Paper: Statistical Comparison of Emotional Activation in Atten...
iMotions White Paper: Statistical Comparison of Emotional Activation in Atten...iMotions White Paper: Statistical Comparison of Emotional Activation in Atten...
iMotions White Paper: Statistical Comparison of Emotional Activation in Atten...iMotionsEyeTracking
 

Similar to safer erlang.PDF (20)

Fiestaru07 2003
Fiestaru07 2003Fiestaru07 2003
Fiestaru07 2003
 
ΠΛΗ31 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 1
ΠΛΗ31 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 1ΠΛΗ31 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 1
ΠΛΗ31 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 1
 
Fichas para trabajar con euros y centimos
Fichas para trabajar con euros y centimosFichas para trabajar con euros y centimos
Fichas para trabajar con euros y centimos
 
Les antigènes de P .Falciparum
Les antigènes de P .FalciparumLes antigènes de P .Falciparum
Les antigènes de P .Falciparum
 
MOB presentació general
MOB presentació generalMOB presentació general
MOB presentació general
 
ΠΛΗ20 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 4
ΠΛΗ20 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 4ΠΛΗ20 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 4
ΠΛΗ20 ΤΥΠΟΛΟΓΙΟ ΕΝΟΤΗΤΑΣ 4
 
Treacle tart
Treacle tartTreacle tart
Treacle tart
 
Decentralized Controllability
Decentralized ControllabilityDecentralized Controllability
Decentralized Controllability
 
Excel 2007 warm up
Excel 2007 warm upExcel 2007 warm up
Excel 2007 warm up
 
Essentials of Ramadan
Essentials of RamadanEssentials of Ramadan
Essentials of Ramadan
 
Essentials of ramadan
Essentials of ramadanEssentials of ramadan
Essentials of ramadan
 
En essentials of_ramadan
En  essentials of_ramadanEn  essentials of_ramadan
En essentials of_ramadan
 
Ricardo%20 gondim%20 %20soli%20deo%20gloria
Ricardo%20 gondim%20 %20soli%20deo%20gloriaRicardo%20 gondim%20 %20soli%20deo%20gloria
Ricardo%20 gondim%20 %20soli%20deo%20gloria
 
Vanilla creme brulee
Vanilla creme bruleeVanilla creme brulee
Vanilla creme brulee
 
Rapport de Situation #3 Tempête Tropicale Sandy
Rapport de Situation #3 Tempête Tropicale SandyRapport de Situation #3 Tempête Tropicale Sandy
Rapport de Situation #3 Tempête Tropicale Sandy
 
Historiografía de la educación comie selección
Historiografía de la educación comie selecciónHistoriografía de la educación comie selección
Historiografía de la educación comie selección
 
Schoolyard compass game
Schoolyard compass gameSchoolyard compass game
Schoolyard compass game
 
Dossier Presentación del Albergue El Último Bucardo
Dossier Presentación del Albergue El Último BucardoDossier Presentación del Albergue El Último Bucardo
Dossier Presentación del Albergue El Último Bucardo
 
Raspberry mousse
Raspberry mousseRaspberry mousse
Raspberry mousse
 
iMotions White Paper: Statistical Comparison of Emotional Activation in Atten...
iMotions White Paper: Statistical Comparison of Emotional Activation in Atten...iMotions White Paper: Statistical Comparison of Emotional Activation in Atten...
iMotions White Paper: Statistical Comparison of Emotional Activation in Atten...
 

safer erlang.PDF

  • 1. ! " # $ % &
  • 2.
  • 3. ' ' ! " # $ % & ' (
  • 4.
  • 5. ' ' ) * ))) + ) " + + + , ) " + + - . % - + / 0 % / - 1 & 2 - + ) " 1 & 2 - - ) " 3 4 - - + 5 5 4 - - - 5 4 - - / 5 6 "7 8 - / 9 " +: - ;1 +:
  • 6. ' ( ' / 9 " & 1 ++ / + ) " <9 " & 1 ++ / - 9 " 1 & +- / / 9 " 9 +- / ;. +- / 2 9 " 9 " +; / =1 +2 ;0 +4 ;+ ) " 0 +4 ;- 5 3 0 +4 ;/ 0 +8 ;/ + 1 +> ;/ - . 3 +> ;/ / & -: ;/ ;6 "7 -+ ;/ 2 & -+ ;/ =1 ( -- ;/ 4 . 0 -/ ;/ 8 ) ( -; ;; (0 ? -; ;2 "7 0 -2 ;=9 " 0 -= ;4 1 7 9 0 -= 2 9 0 -> 2 + ) " 9 0 -> 2 - 990 /: 2 - + /: 2 - - 1 /+ 2 - / & 9 " /= 2 - ;1 & % /4 2 / 9 0 /4 2 / + 1 /4
  • 7. ' ( ' 2 / - /> 2 / / 1 3 ;: 2 ;1 ;- =1 ;2 =+ 5 . ;2 =- 3 ;= =/ 5 6 ;= , ;>
  • 8.
  • 9. 3 " < " 0 @ " 5 ! " 1 0 A B 0 ( 0 A ! " 0 5
  • 10. ' ' " B < B ! " " " % < 0 @ " ) @ # 3 C , C ! " " ! " 5 # ! " < 0 @ 3 0 D 990 9 0 " 7
  • 11. ) % * + ,- ' ' % = D " 7 'B " E ! @ ' E "7 " "7 E # 0 "7 E @ "7 0 @ " E 7
  • 12.
  • 13. ! ! " ! # $ % & ! ! $ ! # $ ' " ( " ! 3 ! ' # 8: F ' ' @ D ! " ! "7 # >: C ! @
  • 14. ' . ' G @ " 5 ( # @ ! 1 @ H I.& @ C J 0 " # ' " " " @ " 5 # @ # ' ! @ 3 # "7 ' @ D • " " # " $ • % " # # " " $ • " # &'" $ • " # " $ • #( # " #)" $ • * " & + " # ( 0 B ' @ ( ' @ "
  • 15. ) % + ) / ' 0 ' , # " ' B # H 9 B .1 5 C . K )& " # # 0 0 # - . .(/" " ' @ G B ' ' L @ # H 9 & M 5 H # @ ' # M # @ H N & ! # ' ! 5 H ! " < @ N M 5 9 ),& - . 0 " 0 ( 0 ( # "
  • 16. ' 1 ' " # " # @ ( - . 1 2 # "7 L # @ @ " 3 @ ( @ 7 "7 O "7 + 2 1 ' @ D ... soma = 0; for (i=1; i<=5; i++) soma = soma + i; ... 0@ - + I P D
  • 17. ) % + ) / ' 2 ' sum [1..5] 0@ - - Q+ 2R G + 2 # " # 5 # 5 1' 5 1' ! 1 +>/= ' "7 5 1' # @ # " @ " @ ' . # " " O " # " O ! " ' "7 O " ' !
  • 18. ' * ' 3 5 @ ' " # @ / ' " @ " " 1 ) " ( " 0 ! # "7 " 1 # " ' H ' "
  • 19. ) * $ +! # $ $ # $ % ' " ( " 43 # ! ( 5 @ 5 " ' 5 # 7 < '
  • 20. ' * ' 3 ! 5 @ ' " " ! B " " @ " # " 3 3 # # @ # @ 5 @ # " @ " B 3 9 @ # @ " B 9 3 9 5 * 5 B D
  • 21. ) % + , ) ' * ' 5 ! @ 0 ! G # 5 # # " 0@ D • " S 0 # ! " "7 # ! # " "7 E • 5 ' '& S 0 " @ 7 ' ! "7 7 " " @ 5 D • 5" S " # ! B 7 # " 0 " # ! E • , & " S 5 ( @ @ " E • S # @ 7 @ E
  • 22. ' *! ' • 5 2 S L " E • 305! S @ # " 9 @ E • , 3 S 0 # @ @ # @ G 5 # 3 3 " @ O D • . " " B @ # E • 5 " 6 B " ! ' E • S E • & " S • 5 S " " 0 "7 ' ( ' B !
  • 23. ) % + , ) ' *3 ' " " " ! " 6 # ' +::T " ' @ 5 ' " " " ' @ # '
  • 24.
  • 25. , - " . # " ! % " ! ! ! $ " 0 0 "7 "7 0 B . , # 8: 0
  • 26. ' *1 ' ! 5 ! ! ' " " C 6 " # ' ( " 0 +>8= " "7 " ( " " " +>84 0 ' K 0 G 0 +>>8 0 " 0 5 9 & 3,& 9 5 - # 0 • " % " S " " ! E • , ( S ' " " E
  • 27. ) % ! + ' *2 ' • ( 6 S ! " ! " E • # # 7 S # @ U V ! E • 5" 6 " S ! E • # " " # S < ' E • &" + 8&"9 8 " S 0 # : ( " 5 # ' @ O @ " 0 # # @ ' B " 0 " B @ H # B C , 0 0 D U V . # #
  • 28. ' ' L # @ D E # G @ W -XE # G Q+ - / ;2R + ' < " Q- / ;2R 5 0 ' G ! 0 ! "9 5 0 ! # ' ( @ " @ W -XY W5 Z X ' 5 ' Z - "7 D desenha (linha) -> ...; desenha (circulo) -> ...; desenha (quadrado)->...; 0@ ;+ " ' # 7 @ "7 "7 case (X) of linha -> ...; circulo -> ...; quadrado -> ... end; 0@ ;- J #
  • 29. ) % ! + ' * ' 1 2 @ # 9 " ; -; factorial(0) -> 1; factorial(N) when N>0 -> N*factorial(N-1). 0@ ;/ " # " D # ;5 # < =9 : 7> 3 "7 G "7 @ D calcula_area(L,C) -> L*C. calcula_area(L,C,A) -> L*C*A. 0@ ;; ! L 0 G # ' "7 ! " -module(matematica). -export([factorial/1]).
  • 30. ' ' factorial(0) -> 1; factorial(N) when N>0 -> N*factorial(N-1). 0@ ;2 3 " ! ( " % " L # " @ ( B -module(contador). -export([loop/1]). loop(Valor) -> receive incrementa -> loop(Valor+1); {From,valor} -> From!{self(),Valor}, loop(Valor); stop -> true; Outro -> loop(Valor) end. 0@ ;= @ (
  • 31. ) % ! + ' ' " B @ ! ... Pid = spawn(contador,loop,[0]), Pid!incrementa, Pid!incrementa, Pid!{self(),valor}, receive {Pid,Valor} -> Valor end, ... 0@ ;4 ! ' 5 # < ' ! ' ! " # 0 @ " ? # Z # " @ # " @ " ' @
  • 32. ' ! ' somar(A,B) -> verifica(catch A + B). verifica({'EXIT',Why}) -> {erro,Why}; verifica(X) -> X. 0@ ;8 # " @ "7 ! somar(A,B) -> catch calc_soma(A,B). calc_soma(A,B) when number(A),number(B) -> A + B; calc_soma(A,B) -> throw({erro,'operandos invalidos'}). 0@ ;> @ % " 0 & # L 0 ' ' ' C 1 ( ' ! " ' ' 0 * % A ( 0 # ? 5 0 B ( " @
  • 33. ) % ! + ' 3 ' ! ' " ' " ! "7 " 0 # 1 # < " 1 # # B " " "7 # ' @ 0 5 0 # @ @ ! " @ - # 2 & # @ "7 0 L "7 G ! ' "7 & " 0 "7 # "
  • 34. ' . ' 3 # "7 ! 0 '@ " @ " " @ " # 1 "7 # 9 # "7 ( D • " S @ E • " + S @ "7 E • # S "7 L 0 # ? " 2 3 ( )90 ' " G "7 @ ( ! " " # # B '
  • 35. ) % ! + ' 0 ' 5 " # # # " ' @ " C @ "7 0 ! "7
  • 36.
  • 37. / * # - ! #% ! - # 0 # 0 % $ 1 ' " ( " 5#( 3 # % 0 @ " # 3 C , C 0@ < " 0 3 9 9 0 990 C , C
  • 38. ' ' 5 9 0 . # " 5 990 0 @ !' C 33 3 C , C 0 # @ B ! B 3 @ 0 ! " ! 3 B ! 7 B @ < U < V 0 " @ # " 0@ # # @ 1 G #
  • 39. ) % 3 + ' * ' G 0 # @ "7 "7 @ 7 C 0 5 @ "7 ' 0 ( 7 [ . # ! " @ 990 ' ' @ G # 3 # "7 ' 9 # 5 @ U V " 3 ! !' " "7
  • 40. ' ' ' U @ V "7 5 @ 0 # " 5 3 C , C 7 U V # G " "7 0 " C 1 ' ' 0 Z # # ' @ " , C 7 D W ! " # $ X D • C S ! E • B S E • D S E • 9 S "7 Q RE
  • 41. ) % 3 + ' ' • 0 S ' ' 3 990 7 ! D • S • S • S • # S • S & 7 ! " @ ,)6 @ !" #! ! ! " ' $ % & U,)6 V @ D • 9 ;B < S ' U V E • = ;0 8B # 8. < S 1 990 "7 @ 0 " • = ;0 8B # <E • = ;B # < S N "7 E • "9 "E; 8. < S N @ "
  • 42. ' ! ' • # E F" ;D < S 1 E • # E F# ;! < S 1 E • "; 8 9 < S 1 E • E ; < S % ' E • =; < S % < . # D • " ;B< S N # E • # ;B< S N # E • ;B< S N # E • ;B< S N # E • ;B< S N # E • # ; 8 < B N 6 # ' ,)6 ' @ • C;! 8185< S % ' 9 G ' ' # @ @ E • "9 "EF " F" ;0 8! < S ' E • + ;0 8 < S ' E • F ;< S E
  • 43. ) % 3 + ' 3 ' • F ;- 8 0 < S & E • E ;0 < S 0 ' E • E;0 < S E • F F ;- < S % E • # F ;B 81 < S ! E • ; #< S % # U VE • ;< S % E • F ;0 B # 80 3 < S % @ E • F F ;0 < S E • " ;B < S % ! E • " F & ;0 <$ • " F & ;0 8 #< S E • ;B # 8 < S % E • ;< S % E • ; 8! < S % (% W XE • = ;! 8185<$ • = ;B 8! 8185<$
  • 44. ' . ' • = F E;! 8185<$ • = F E;B 8! 8185< S 1 ! % ' E • " ;0 8G =81 - < S E • E;0 < S E • ;B # <$ • ; < S 3 @ E • =9 ;B # < S % ! 3 ' @ "7 G 990 "7 • "+; 8H 9 < S % @ B )$ E • "C ;B # 80 "C< • "C ;0 8B # 80 "C< S 1 F E • & ;B # 80 "C< • & ;0 8 B # 8 0 "C< S 1 F ' " E • F" ;1 B # < S ( E • = F" ;1 B # 8 < S 0 0 G "7 ! ' 0 U V
  • 45. ) % 3 + ' 0 ' # ! # 0 ( " @ O ( # ( ' " !!' 9 ' 3 & 9 "7 0 "7 ! < ,)6 "7 # " " # ' #
  • 46. ' 1 ' 0@ / # D • 0@ *"+ UV ( @ # E • 1 E • 1 ' 6 "7 ! 0 ,)6 ! B < ! 5 # 6 ,)6 # @ G ,)6 ! 6 # 5 " # ' @ 9 B ' " ' 0 #
  • 47. ) % 3 + ' 2 ' !7 " # ' " " # ' " ,)6 # ' 'B ' ! ) @ < " ! B ( B ) 0 # B ,)6 0 " "7 0 "7 "7 " " ,)6 0 # ! # 0 U V ( " Z # B ! @ "
  • 48. ' ! ' , ! # # , ( 5 " 0 " % # " " 0 % ' ! 1 % ' % & # ' ! ! B 1 " • E ; < S . E • # ;58 < S % E • =; < S % G -" ! & .'" ! # @ & # E • "; 8- < S % B E
  • 49. ) % 3 + ' !* ' • ( ;B # I8. J< S 1 B ( "7 E • F# ;! < S % % % E • # ;< S % E • 9 = ;B< S 3 E • " F ;B8 C 8 8 < S % ( " / E • F# ;B8B # 8! < S % % E • F# ;B8B # < S 5 @ 1 • C;! 8185< S 0@ % E • = ;! 8185< S 0@ % E • = F E;! 8185< S 0@ % E • = ;B8! 8185< S 0@ % E • = F E;B8 ! 8 18 5< S 0@ % E • + ; 8 E < S 0 # / 0 • =9 ;B # < S % E • F F ;- < S % E • " ;< S % E • ; < S 9 ! ' 1 # • F# ;! <
  • 50. ' ! ' • F# ;! 8 C< • # F ;! < • F# ;! < • F ;< • ;B # 80 < • 9 ;< • " "F ;B < • F" E ;< • F" E ;B 8 "E < • F ;- 80 < • "9 "EF " F" ;0 8! < " 5 # " 0 ( 6 # ! C ! "7 B ,)6 0 !
  • 51. ) % 3 + ' ! ' % B 9 0 # " 5 # 0
  • 52.
  • 53. 2 3 # . ( 9 5 ! "7 " # @ ] ' " . 0 6 @ "7 ( ! " "7 ! 5 ' #
  • 54. ' !. ' 112 1 2 ( 0 6 U V C , C O " ' # ' ( 0 , &" 5 ' 990 9 0 5 # # 5 ' 0 990 9 0 @ @ [ . 1 5 B ' ! ! H # " "
  • 55. ) % . + ) - ' !0 ' % 0 ' ' 0 ^) ' 60L B G "7 " ' & ' 0 # ! # "7 @ 7 0 990 9 0 ( 1 " ( " 0
  • 56.
  • 57. ( $ # 0 • H I 3 + % • 9( 6 6 1 4 5 46 * 5 %7 • 1 0 9 % 8 +>>> • & 3 6 3 2 & 49 1 :% /7 -::+ • 3 9 / + & 2 ; 5 < +>>= • I M 6 5_, 2 = " 1 + & 2 • C , C 112 ; 1 2 +>>4 • C , C / 1 112 +>>4 • C , C % / 1
  • 58. ' 3 ' • C , C 2 ; 5 < 1 & $ > 5 +>>> • 1 2 3 • CCC S 9 0 • CCC P S 9 I P • CCC C F` FB 9 C , C • CCC C P S a P # # • CCC S &