From d725e8e385f8d89fa9c89fb20a248d5293a647c3 Mon Sep 17 00:00:00 2001 From: Antoine Paris Date: Fri, 28 Nov 2014 17:16:32 +0100 Subject: [PATCH 1/7] Add Oz to languages.yml --- lib/linguist/languages.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 699301aa..082a0d96 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2932,3 +2932,9 @@ xBase: extensions: - .prg tm_scope: none + +Oz: + type:programming + color: "#fcaf3e" + extensions: + - .oz From d60241cc864fb4d45773e16fa7cadd1aadb51992 Mon Sep 17 00:00:00 2001 From: Antoine Paris Date: Fri, 28 Nov 2014 17:28:22 +0100 Subject: [PATCH 2/7] Add grammar for Oz --- grammars.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grammars.yml b/grammars.yml index 10361eef..fe64608a 100644 --- a/grammars.yml +++ b/grammars.yml @@ -408,3 +408,5 @@ https://github.com/vmg/zephir-sublime: - source.php.zephir https://github.com/whitequark/llvm.tmbundle: - source.llvm +https://github.com/sujithps/oz: +- source.oz From 57b0739219c1e2d763f25c553ef6edb5b9a595d1 Mon Sep 17 00:00:00 2001 From: Antoine Paris Date: Fri, 28 Nov 2014 17:40:49 +0100 Subject: [PATCH 3/7] Add some examples for Oz --- samples/Oz/example.oz | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 samples/Oz/example.oz diff --git a/samples/Oz/example.oz b/samples/Oz/example.oz new file mode 100644 index 00000000..49e5d65a --- /dev/null +++ b/samples/Oz/example.oz @@ -0,0 +1,52 @@ +% You can get a lot of information about Oz by following theses links : +% - http://mozart.github.io/ +% - http://en.wikipedia.org/wiki/Oz_(programming_language) +% The is also a well known book that uses Oz for pedagogical reason : +% - http://mitpress.mit.edu/books/concepts-techniques-and-models-computer-programming +% And there are two courses on edX about 'Paradigms of Computer Programming' that also uses Oz for pedagocial reason : +% - https://www.edx.org/node/2751#.VHijtfl5OSo +% - https://www.edx.org/node/4436#.VHijzfl5OSo +% +% Here is an example of some code written with Oz. + +declare +% Computes the sum of square of the N first integers. +fun {Sum N} + local SumAux in + fun {SumAux N Acc} + if N==0 then Acc + else + {Sum N-1 Acc} + end + end + {SumAux N 0} + end +end + +% Returns true if N is a prime and false otherwize +fun {Prime N} + local PrimeAcc in + fun {PrimeAcc N Acc} + if(N == 1) then false + elseif(Acc == 1) then true + else + if (N mod Acc) == 0 then false + else + {PrimeAcc N Acc-1} + end + end + end + {PrimeAcc N (N div 2)} + end +end + +% Reverse a list using cells and for loop (instead of recursivity) +fun {Reverse L} + local RevList in + RevList = {NewCell nil} + for E in L do + RevList := E|@RevList + end + @RevList + end +end From 71e1bd9af2af036252c7aac898a91b2e9fcea2c6 Mon Sep 17 00:00:00 2001 From: Antoine Paris Date: Fri, 28 Nov 2014 17:42:54 +0100 Subject: [PATCH 4/7] Misspelling correction --- samples/Oz/example.oz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Oz/example.oz b/samples/Oz/example.oz index 49e5d65a..e7438056 100644 --- a/samples/Oz/example.oz +++ b/samples/Oz/example.oz @@ -3,7 +3,7 @@ % - http://en.wikipedia.org/wiki/Oz_(programming_language) % The is also a well known book that uses Oz for pedagogical reason : % - http://mitpress.mit.edu/books/concepts-techniques-and-models-computer-programming -% And there are two courses on edX about 'Paradigms of Computer Programming' that also uses Oz for pedagocial reason : +% And there are two courses on edX about 'Paradigms of Computer Programming' that also uses Oz for pedagogical reason : % - https://www.edx.org/node/2751#.VHijtfl5OSo % - https://www.edx.org/node/4436#.VHijzfl5OSo % From b7a98437703b45ee8459c1782db1b653b06290a2 Mon Sep 17 00:00:00 2001 From: Antoine Paris Date: Sun, 30 Nov 2014 21:18:23 +0100 Subject: [PATCH 5/7] Corrections by @pchaigno --- lib/linguist/languages.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 082a0d96..cc2f8031 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1843,6 +1843,13 @@ Oxygene: extensions: - .oxygene tm_scope: none + +Oz: + type: programming + color: "#fcaf3e" + extensions: + - .oz + tm_scope: source.oz PAWN: type: programming @@ -2932,9 +2939,3 @@ xBase: extensions: - .prg tm_scope: none - -Oz: - type:programming - color: "#fcaf3e" - extensions: - - .oz From da96e11b37b31d8fe0a4ac8a8a981217d7318101 Mon Sep 17 00:00:00 2001 From: Antoine Paris Date: Sun, 30 Nov 2014 22:01:39 +0100 Subject: [PATCH 6/7] Add grammar for Oz --- grammars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammars.yml b/grammars.yml index fe64608a..35c66ebb 100644 --- a/grammars.yml +++ b/grammars.yml @@ -408,5 +408,5 @@ https://github.com/vmg/zephir-sublime: - source.php.zephir https://github.com/whitequark/llvm.tmbundle: - source.llvm -https://github.com/sujithps/oz: +https://github.com/eregon/oz-tmbundle: - source.oz From 4495e15fa7331ed586ae44dd116bfd979d83715f Mon Sep 17 00:00:00 2001 From: Antoine Paris Date: Sun, 30 Nov 2014 22:07:55 +0100 Subject: [PATCH 7/7] Misspelling correction --- samples/Oz/example.oz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Oz/example.oz b/samples/Oz/example.oz index e7438056..21c206a2 100644 --- a/samples/Oz/example.oz +++ b/samples/Oz/example.oz @@ -1,7 +1,7 @@ % You can get a lot of information about Oz by following theses links : % - http://mozart.github.io/ % - http://en.wikipedia.org/wiki/Oz_(programming_language) -% The is also a well known book that uses Oz for pedagogical reason : +% There is also a well known book that uses Oz for pedagogical reason : % - http://mitpress.mit.edu/books/concepts-techniques-and-models-computer-programming % And there are two courses on edX about 'Paradigms of Computer Programming' that also uses Oz for pedagogical reason : % - https://www.edx.org/node/2751#.VHijtfl5OSo