This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(transform). | |
-export([main/1]). | |
main(File) -> | |
case compile:file(File, [to_core, binary, no_copt]) of | |
{ok, ModuleName, CoreForms} -> | |
TransForms = cerl_trees:map(fun replace_concat/1, CoreForms), | |
CoreName = atom_to_list(ModuleName) ++ ".core", | |
file:write_file(CoreName, | |
cerl_prettypr:format(TransForms)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2> Name = resta. | |
resta | |
3> Lista = [{function,suma,3},{function,resta,5},{function,mult,4}]. | |
[{function,suma,3},{function,resta,5},{function,mult,4}] | |
4> [FunctionName || Form = {function,FunctionName,_} <- Lista, FunctionName == Name]. | |
[resta] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(receiver). | |
-export([main/0]). | |
main() -> receive | |
terminate -> io:fwrite("Receiver process finished\n") | |
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> add :: [(String,[Expr])] -> [(String,[Expr])] -> [(String,[Expr])] -> [(String,[Expr])] | |
> | |
> add succ pending marked = difference (union pending succ) marked | |
> | |
> union pending [] = pending | |
> union pending (call:res) | |
> | elem call pending = union pending res | |
> | otherwise = union (call:pending) res | |
> | |
> difference pend marked = [x | x <- pend, not (elem x marked)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p1 = cadena1; | |
p2 = cadena2; | |
for (int i = 0; i < strlen(cadena1); i++) | |
{ | |
if (*p1 > 'a' && *p1 < 'z') | |
*p2 = *p1 + ('A' - 'a'); | |
else *p2 = *p1; | |
p1++; | |
p2++; |