From df88b47cdafcc2e04452456942ea572a7b72e2f2 Mon Sep 17 00:00:00 2001 From: Lars G Thorsen Date: Tue, 26 Jan 2010 10:13:35 +0000 Subject: OTP-8343 The documentation is now possible to build in an open source environment after a number of bugs are fixed and some features are added in the documentation build process. - The arity calculation is updated. - The module prefix used in the function names for bif's are removed in the generated links so the links will look like http://www.erlang.org/doc/man/erlang.html#append_element-2 instead of http://www.erlang.org/doc/man/erlang.html#erlang:append_element-2 - Enhanced the menu positioning in the html documentation when a new page is loaded. - A number of corrections in the generation of man pages (thanks to Sergei Golovan) - Moved some man pages to more apropriate sections, pages in section 4 moved to 5 and pages in 6 moved to 7. - The legal notice is taken from the xml book file so OTP's build process can be used for non OTP applications. --- system/doc/extensions/list_comrehensions.erl | 75 ---------------------------- 1 file changed, 75 deletions(-) delete mode 100644 system/doc/extensions/list_comrehensions.erl (limited to 'system/doc/extensions/list_comrehensions.erl') diff --git a/system/doc/extensions/list_comrehensions.erl b/system/doc/extensions/list_comrehensions.erl deleted file mode 100644 index f6a23b5dca..0000000000 --- a/system/doc/extensions/list_comrehensions.erl +++ /dev/null @@ -1,75 +0,0 @@ --module(zf). - --compile(export_all). - - -%% Odd numbers. - -%%foo(L) -> [ X || X <- L, (X > X-1) == (X /= X-1) ]. - -boo() -> [X||X <- [1,2,a,3,4,b,5,6], X > 3]. -boo1() -> [X||X <- [1,2,a,3,4,b,5,6], integer(X),X > 3]. -boo2() -> [{X,Y} || X <- [1,2,3], Y <- [a,b]]. - -bar(L) -> [ X || X <- L, integer(X), gt(X, 3) ]. - -bar(L, M) -> [ Y || X <- L, integer(X), gt(X, 3), - Y <- M, float(Y), gt(X, Y) - ]. - -baz(L) -> [ X || X <- L, atom(X) ]. - -buz(L, Min) -> [ X || Min > 3, X <- L, X >= Min ]. - -gt(X, Y) when X > Y -> true; -gt(X, Y) -> false. - - -%% Return the Pythagorean triangles with sides -%% of total length less than N -pyth(N) -> - [ {A,B,C} || - A <- lists:seq(1,N), - B <- lists:seq(1,N), - C <- lists:seq(1,N), - A+B+C =< N, - A*A+B*B == C*C - ]. - -%% Cut the search space a bit.. -pyth2(N) -> - [ {A,B,C} || - A <- lists:seq(1,N), - B <- lists:seq(1,N-A+1), - C <- lists:seq(1,N-A-B+2), - A+B+C =< N, - A*A+B*B == C*C ]. - -%% Return the Cartesian product - -cp(A,B) -> - [ {X,Y} || - X <- A, - Y <- B - ]. - -%% Return all permutations of a list -perms([]) -> [[]]; -perms(L) -> [ [H|T] || H <- L, T <- perms(L--[H]) ]. - -%% Quick sort -sort([X|Xs]) -> - sort([ Y || Y <- Xs, Y < X ]) ++ - [X] ++ - sort([ Y || Y <- Xs, Y >= X ]); -sort([]) -> []. - -%% append - -append(L) -> [X||L1<-L,X<-L1]. - -map(Fun, L) -> [Fun(X)||X<-L]. - -filter(Pred, L) -> [X||X<-L,Pred(X)]. - -select(X, L) -> [Y || {X1,Y} <- L, X == X1]. -- cgit v1.2.3