├── .gitignore ├── src └── leiningen │ └── new │ ├── frege │ ├── FibonacciTest.fr │ ├── core.clj │ ├── core_test.clj │ ├── README.pure.md │ ├── project.pure.clj │ ├── README.md │ ├── Fibonacci.fr │ ├── project.clj │ ├── BSD │ └── EPL │ └── frege.clj ├── project.clj ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | pom.xml 2 | pom.xml.asc 3 | *jar 4 | /lib/ 5 | /classes/ 6 | /target/ 7 | /checkouts/ 8 | .lein-deps-sum 9 | .lein-repl-history 10 | .lein-plugins/ 11 | .lein-failures 12 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/FibonacciTest.fr: -------------------------------------------------------------------------------- 1 | module FibonacciTest where 2 | 3 | import Test.QuickCheck 4 | import Fibonacci 5 | 6 | fib0 = once $ fib 0 == 0 7 | fib1 = once $ fib 1 == 1 8 | fib2 = once $ fib 2 == 1 9 | fib10 = once $ fib 10 == 55 10 | -------------------------------------------------------------------------------- /project.clj: -------------------------------------------------------------------------------- 1 | (defproject frege/lein-template "3.24-7.100c" 2 | :description "Leiningen template for Frege / Clojure projects" 3 | :url "https://github.com/Frege/frege-lein-template" 4 | :license {:name "BSD 3-clause" 5 | :url "http://opensource.org/licenses/BSD-3-Clause"} 6 | :eval-in-leiningen true) 7 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/core.clj: -------------------------------------------------------------------------------- 1 | (ns {{name}}.core 2 | (:gen-class) 3 | ;; import the Frege main class (module) 4 | (:import Fibonacci)) 5 | 6 | (defn -main 7 | "I am a Clojure main that calls Frege code." 8 | [& args] 9 | (println "Hello, World!") 10 | (doseq [n (range 10)] 11 | (println "Fibonacci number" n "is" 12 | ;; Java 7 compatible Frege; pass lazy long 13 | (Fibonacci/fib (frege.run7.Thunk/lazy n)) 14 | "(called via lazy fib)") 15 | (println "Fibonacci number" n "is" 16 | (Fibonacci/fib$tick n) 17 | "(called via eager fib')"))) 18 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/core_test.clj: -------------------------------------------------------------------------------- 1 | (ns {{name}}.core-test 2 | (:require [clojure.test :refer :all] 3 | [{{name}}.core :refer :all]) 4 | ;; import the Frege code you want to test 5 | (:import Fibonacci)) 6 | 7 | (deftest test-fib 8 | (is (= 0 (Fibonacci/fib (frege.run7.Thunk/lazy 0)))) 9 | (is (= 1 (Fibonacci/fib (frege.run7.Thunk/lazy 1)))) 10 | (is (= 1 (Fibonacci/fib (frege.run7.Thunk/lazy 2)))) 11 | (is (= 55 (Fibonacci/fib (frege.run7.Thunk/lazy 10))))) 12 | 13 | (deftest test-fib' 14 | (is (= 0 (Fibonacci/fib$tick 0))) 15 | (is (= 1 (Fibonacci/fib$tick 1))) 16 | (is (= 1 (Fibonacci/fib$tick 2))) 17 | (is (= 55 (Fibonacci/fib$tick 10)))) 18 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/README.pure.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | Example of pure Frege language project. 4 | 5 | ## Usage 6 | 7 | Run the Frege compiler and then run the Fibonacci main function: 8 | 9 | lein fregec :run Fibonacci 10 | 11 | Run the Frege compiler and then run the tests: 12 | 13 | lein fregec :test -v FibonacciTest 14 | 15 | You can also package up the Frege code and its runtime: 16 | 17 | lein uberjar 18 | 19 | That produces a JAR file which you can run: 20 | 21 | java -cp target/{{name}}-0.1.0-SNAPSHOT-standalone.jar Fibonacci 22 | 23 | ## License 24 | 25 | Copyright (c) 2015 Your Name 26 | 27 | Distributed under the BSD 3-clause License, the same as Frege. 28 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/project.pure.clj: -------------------------------------------------------------------------------- 1 | (defproject {{name}} "0.1.0-SNAPSHOT" 2 | :description "Example pure Frege language application" 3 | :url "http://example.com/FIXME" 4 | ;; Frege is typically a BSD license 5 | :license {:name "BSD 3-clause" 6 | :url "http://opensource.org/licenses/BSD-3-Clause"} 7 | :dependencies [;; need to depend on Frege for runtime: 8 | [org.frege-lang/frege "3.24-7.100"]] 9 | :repositories {"sonatype" "https://oss.sonatype.org/content/repositories/snapshots/"} 10 | :plugins [[lein-fregec "3.24-7.100"]] 11 | :frege-source-paths ["src" "test"] 12 | :fregec-options ["-target" "1.7"] 13 | :profiles {:uberjar {:aot :all 14 | :prep-tasks ["fregec" "compile"]}}) 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # frege-lein-template 2 | 3 | A Leiningen template for creating new (mixed language) Clojure / Frege projects. 4 | 5 | ## Usage 6 | 7 | lein new frege myapp 8 | 9 | This will create a folder called `myapp` containing the skeleton of a pure Frege project with a Frege main function and tests. See the generated `README.md` for details of how to run the program and tests. 10 | 11 | lein new frege myapp -- :with-clojure 12 | 13 | This will create a folder called `myapp` containing the skeleton of a Frege project with a Clojure main function and Clojure tests. See the generated `README.md` for details of how to run the tests, how to run the Clojure / Frege project, and how to run the Frege code as a standalone app. 14 | 15 | ## License 16 | 17 | Copyright © 2015-2016 Sean Corfield / Frege 18 | 19 | Distributed under the BSD 3-clause License, the same as Frege itself. 20 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | Example of Clojure / Frege mixed language project. Clojure main program calls Frege function. 4 | 5 | ## Usage 6 | 7 | Run the Frege compiler and then run the Clojure application: 8 | 9 | lein do fregec, run 10 | 11 | Run the Clojure tests (which exercise the Frege functions): 12 | 13 | lein do fregec, test 14 | 15 | Run the Frege compiler and then run the Fibonacci main function: 16 | 17 | lein fregec :run Fibonacci 18 | 19 | You can also package up all the Clojure and Frege code and their runtimes: 20 | 21 | lein uberjar 22 | 23 | That produces a JAR file which you can run: 24 | 25 | java -jar target/{{name}}-0.1.0-SNAPSHOT-standalone.jar 26 | 27 | ## License 28 | 29 | Copyright (c) 2015 Your Name 30 | 31 | Distributed under the Eclipse Public License, the same as Clojure (or the BSD 3-clause License, the same as Frege). 32 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/Fibonacci.fr: -------------------------------------------------------------------------------- 1 | module Fibonacci where 2 | 3 | -- lazy infinite sequence of Fibonacci numbers starting with a, b: 4 | fibs a b = a : fibs b (a + b) 5 | 6 | -- lazy infinite sequence of Fibonacci numbers (0, 1, 1, 2, 3, ...): 7 | -- using 0L and 1L instead of 0 and 1 ensure type is inferred as [Long] 8 | fibonacci = fibs 0L 1L 9 | 10 | -- exposed API infers type as (lazy) Long -> Long: 11 | -- call with (frege.run7.Thunk/lazy 42) 12 | -- drop takes an Int so we need to cast from Long 13 | fib n = head $ drop (Long.int n) $ fibonacci 14 | 15 | -- alternative eager API infers type as Long -> Long: 16 | -- call with 42 directly, as fib$tick 17 | -- drop takes an Int so we need to cast from Long 18 | fib' !n = head $ drop (Long.int n) $ fibonacci 19 | 20 | -- example Frege main that can be run directly: 21 | -- lein fregec :run Fibonacci 22 | main _ = do 23 | print "Fibonacci 12 = " 24 | println $ fib 12 25 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/project.clj: -------------------------------------------------------------------------------- 1 | (defproject {{name}} "0.1.0-SNAPSHOT" 2 | :description "Example Clojure / Frege mixed language application" 3 | :url "http://example.com/FIXME" 4 | ;; Clojure is typically an EPL license 5 | :license {:name "Eclipse Public License" 6 | :url "http://www.eclipse.org/legal/epl-v10.html"} 7 | ;; Frege is typically a BSD license 8 | ;; :license {:name "BSD 3-clause" 9 | ;; :url "http://opensource.org/licenses/BSD-3-Clause"} 10 | :dependencies [;; Clojure runtime for mixed Clojure / Frege projects: 11 | [org.clojure/clojure "1.7.0"] 12 | ;; need to depend on Frege for runtime: 13 | [org.frege-lang/frege "3.24-7.100"]] 14 | :repositories {"sonatype" "https://oss.sonatype.org/content/repositories/snapshots/"} 15 | :plugins [[lein-fregec "3.24-7.100"]] 16 | :source-paths ["src/clj"] 17 | :test-paths ["test/clj"] 18 | :frege-source-paths ["src/frege"] 19 | :fregec-options ["-target" "1.7"] 20 | :main {{name}}.core 21 | :profiles {:uberjar {:aot :all 22 | :prep-tasks ["fregec" "compile"]}}) 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Frege 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of frege-lein-template nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/BSD: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Frege 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of frege-lein-plugin nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /src/leiningen/new/frege.clj: -------------------------------------------------------------------------------- 1 | (ns leiningen.new.frege 2 | (:require [leiningen.new.templates :refer [renderer name-to-path ->files]] 3 | [leiningen.core.main :as main])) 4 | 5 | (def render (renderer "frege")) 6 | 7 | (defn frege 8 | "Create a mixed Clojure / Frege project template. 9 | Supported arguments: 10 | :with-clojure -- base template should include Clojure main." 11 | [name & args] 12 | (let [with-clojure (= ":with-clojure" (first args)) 13 | data {:name name 14 | :sanitized (name-to-path name)}] 15 | (main/info (str "Generating fresh 'lein new' frege project" 16 | (when with-clojure 17 | ", with Clojure entry point") 18 | ".")) 19 | (if with-clojure 20 | (->files data 21 | ["LICENSE-EPL" (render "EPL" data)] 22 | ["LICENSE-BSD" (render "BSD" data)] 23 | ["README.md" (render "README.md" data)] 24 | ["project.clj" (render "project.clj" data)] 25 | ["src/clj/{{sanitized}}/core.clj" (render "core.clj" data)] 26 | ["test/clj/{{sanitized}}/core_test.clj" (render "core_test.clj" data)] 27 | ["src/frege/{{sanitized}}/Fibonacci.fr" (render "Fibonacci.fr" data)]) 28 | (->files data 29 | ["LICENSE" (render "BSD" data)] 30 | ["README.md" (render "README.pure.md" data)] 31 | ["project.clj" (render "project.pure.clj" data)] 32 | ["src/{{sanitized}}/Fibonacci.fr" (render "Fibonacci.fr" data)] 33 | ["test/{{sanitized}}/FibonacciTest.fr" (render "FibonacciTest.fr" data)])))) 34 | -------------------------------------------------------------------------------- /src/leiningen/new/frege/EPL: -------------------------------------------------------------------------------- 1 | Eclipse Public License - v 1.0 2 | 3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC 4 | LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM 5 | CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 6 | 7 | 1. DEFINITIONS 8 | 9 | "Contribution" means: 10 | 11 | a) in the case of the initial Contributor, the initial code and documentation 12 | distributed under this Agreement, and 13 | b) in the case of each subsequent Contributor: 14 | i) changes to the Program, and 15 | ii) additions to the Program; 16 | 17 | where such changes and/or additions to the Program originate from and are 18 | distributed by that particular Contributor. A Contribution 'originates' from 19 | a Contributor if it was added to the Program by such Contributor itself or 20 | anyone acting on such Contributor's behalf. Contributions do not include 21 | additions to the Program which: (i) are separate modules of software 22 | distributed in conjunction with the Program under their own license 23 | agreement, and (ii) are not derivative works of the Program. 24 | 25 | "Contributor" means any person or entity that distributes the Program. 26 | 27 | "Licensed Patents" mean patent claims licensable by a Contributor which are 28 | necessarily infringed by the use or sale of its Contribution alone or when 29 | combined with the Program. 30 | 31 | "Program" means the Contributions distributed in accordance with this Agreement. 32 | 33 | "Recipient" means anyone who receives the Program under this Agreement, 34 | including all Contributors. 35 | 36 | 2. GRANT OF RIGHTS 37 | a) Subject to the terms of this Agreement, each Contributor hereby grants 38 | Recipient a non-exclusive, worldwide, royalty-free copyright license to 39 | reproduce, prepare derivative works of, publicly display, publicly perform, 40 | distribute and sublicense the Contribution of such Contributor, if any, and 41 | such derivative works, in source code and object code form. 42 | b) Subject to the terms of this Agreement, each Contributor hereby grants 43 | Recipient a non-exclusive, worldwide, royalty-free patent license under 44 | Licensed Patents to make, use, sell, offer to sell, import and otherwise 45 | transfer the Contribution of such Contributor, if any, in source code and 46 | object code form. This patent license shall apply to the combination of the 47 | Contribution and the Program if, at the time the Contribution is added by 48 | the Contributor, such addition of the Contribution causes such combination 49 | to be covered by the Licensed Patents. The patent license shall not apply 50 | to any other combinations which include the Contribution. No hardware per 51 | se is licensed hereunder. 52 | c) Recipient understands that although each Contributor grants the licenses to 53 | its Contributions set forth herein, no assurances are provided by any 54 | Contributor that the Program does not infringe the patent or other 55 | intellectual property rights of any other entity. Each Contributor 56 | disclaims any liability to Recipient for claims brought by any other entity 57 | based on infringement of intellectual property rights or otherwise. As a 58 | condition to exercising the rights and licenses granted hereunder, each 59 | Recipient hereby assumes sole responsibility to secure any other 60 | intellectual property rights needed, if any. For example, if a third party 61 | patent license is required to allow Recipient to distribute the Program, it 62 | is Recipient's responsibility to acquire that license before distributing 63 | the Program. 64 | d) Each Contributor represents that to its knowledge it has sufficient 65 | copyright rights in its Contribution, if any, to grant the copyright 66 | license set forth in this Agreement. 67 | 68 | 3. REQUIREMENTS 69 | 70 | A Contributor may choose to distribute the Program in object code form under its 71 | own license agreement, provided that: 72 | 73 | a) it complies with the terms and conditions of this Agreement; and 74 | b) its license agreement: 75 | i) effectively disclaims on behalf of all Contributors all warranties and 76 | conditions, express and implied, including warranties or conditions of 77 | title and non-infringement, and implied warranties or conditions of 78 | merchantability and fitness for a particular purpose; 79 | ii) effectively excludes on behalf of all Contributors all liability for 80 | damages, including direct, indirect, special, incidental and 81 | consequential damages, such as lost profits; 82 | iii) states that any provisions which differ from this Agreement are offered 83 | by that Contributor alone and not by any other party; and 84 | iv) states that source code for the Program is available from such 85 | Contributor, and informs licensees how to obtain it in a reasonable 86 | manner on or through a medium customarily used for software exchange. 87 | 88 | When the Program is made available in source code form: 89 | 90 | a) it must be made available under this Agreement; and 91 | b) a copy of this Agreement must be included with each copy of the Program. 92 | Contributors may not remove or alter any copyright notices contained within 93 | the Program. 94 | 95 | Each Contributor must identify itself as the originator of its Contribution, if 96 | any, in a manner that reasonably allows subsequent Recipients to identify the 97 | originator of the Contribution. 98 | 99 | 4. COMMERCIAL DISTRIBUTION 100 | 101 | Commercial distributors of software may accept certain responsibilities with 102 | respect to end users, business partners and the like. While this license is 103 | intended to facilitate the commercial use of the Program, the Contributor who 104 | includes the Program in a commercial product offering should do so in a manner 105 | which does not create potential liability for other Contributors. Therefore, if 106 | a Contributor includes the Program in a commercial product offering, such 107 | Contributor ("Commercial Contributor") hereby agrees to defend and indemnify 108 | every other Contributor ("Indemnified Contributor") against any losses, damages 109 | and costs (collectively "Losses") arising from claims, lawsuits and other legal 110 | actions brought by a third party against the Indemnified Contributor to the 111 | extent caused by the acts or omissions of such Commercial Contributor in 112 | connection with its distribution of the Program in a commercial product 113 | offering. The obligations in this section do not apply to any claims or Losses 114 | relating to any actual or alleged intellectual property infringement. In order 115 | to qualify, an Indemnified Contributor must: a) promptly notify the Commercial 116 | Contributor in writing of such claim, and b) allow the Commercial Contributor to 117 | control, and cooperate with the Commercial Contributor in, the defense and any 118 | related settlement negotiations. The Indemnified Contributor may participate in 119 | any such claim at its own expense. 120 | 121 | For example, a Contributor might include the Program in a commercial product 122 | offering, Product X. That Contributor is then a Commercial Contributor. If that 123 | Commercial Contributor then makes performance claims, or offers warranties 124 | related to Product X, those performance claims and warranties are such 125 | Commercial Contributor's responsibility alone. Under this section, the 126 | Commercial Contributor would have to defend claims against the other 127 | Contributors related to those performance claims and warranties, and if a court 128 | requires any other Contributor to pay any damages as a result, the Commercial 129 | Contributor must pay those damages. 130 | 131 | 5. NO WARRANTY 132 | 133 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN 134 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR 135 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, 136 | NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each 137 | Recipient is solely responsible for determining the appropriateness of using and 138 | distributing the Program and assumes all risks associated with its exercise of 139 | rights under this Agreement , including but not limited to the risks and costs 140 | of program errors, compliance with applicable laws, damage to or loss of data, 141 | programs or equipment, and unavailability or interruption of operations. 142 | 143 | 6. DISCLAIMER OF LIABILITY 144 | 145 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY 146 | CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, 147 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST 148 | PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 149 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 150 | OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS 151 | GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 152 | 153 | 7. GENERAL 154 | 155 | If any provision of this Agreement is invalid or unenforceable under applicable 156 | law, it shall not affect the validity or enforceability of the remainder of the 157 | terms of this Agreement, and without further action by the parties hereto, such 158 | provision shall be reformed to the minimum extent necessary to make such 159 | provision valid and enforceable. 160 | 161 | If Recipient institutes patent litigation against any entity (including a 162 | cross-claim or counterclaim in a lawsuit) alleging that the Program itself 163 | (excluding combinations of the Program with other software or hardware) 164 | infringes such Recipient's patent(s), then such Recipient's rights granted under 165 | Section 2(b) shall terminate as of the date such litigation is filed. 166 | 167 | All Recipient's rights under this Agreement shall terminate if it fails to 168 | comply with any of the material terms or conditions of this Agreement and does 169 | not cure such failure in a reasonable period of time after becoming aware of 170 | such noncompliance. If all Recipient's rights under this Agreement terminate, 171 | Recipient agrees to cease use and distribution of the Program as soon as 172 | reasonably practicable. However, Recipient's obligations under this Agreement 173 | and any licenses granted by Recipient relating to the Program shall continue and 174 | survive. 175 | 176 | Everyone is permitted to copy and distribute copies of this Agreement, but in 177 | order to avoid inconsistency the Agreement is copyrighted and may only be 178 | modified in the following manner. The Agreement Steward reserves the right to 179 | publish new versions (including revisions) of this Agreement from time to time. 180 | No one other than the Agreement Steward has the right to modify this Agreement. 181 | The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation 182 | may assign the responsibility to serve as the Agreement Steward to a suitable 183 | separate entity. Each new version of the Agreement will be given a 184 | distinguishing version number. The Program (including Contributions) may always 185 | be distributed subject to the version of the Agreement under which it was 186 | received. In addition, after a new version of the Agreement is published, 187 | Contributor may elect to distribute the Program (including its Contributions) 188 | under the new version. Except as expressly stated in Sections 2(a) and 2(b) 189 | above, Recipient receives no rights or licenses to the intellectual property of 190 | any Contributor under this Agreement, whether expressly, by implication, 191 | estoppel or otherwise. All rights in the Program not expressly granted under 192 | this Agreement are reserved. 193 | 194 | This Agreement is governed by the laws of the State of New York and the 195 | intellectual property laws of the United States of America. No party to this 196 | Agreement will bring a legal action under this Agreement more than one year 197 | after the cause of action arose. Each party waives its rights to a jury trial in 198 | any resulting litigation. 199 | --------------------------------------------------------------------------------