├── .gitignore ├── Clojure ├── Clojure.Compile │ ├── Clojure.Compile.csproj │ ├── Compile.cs │ ├── GlobalSuppressions.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── Clojure.Main │ ├── Clojure.Main.csproj │ ├── GlobalSuppressions.cs │ ├── Main.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── clojure-icon.ico │ └── packages.config ├── Clojure.Source │ ├── Clojure.Source.csproj │ └── clojure │ │ ├── ants.clj │ │ ├── clr │ │ ├── io.clj │ │ └── shell.clj │ │ ├── core.clj │ │ ├── core │ │ └── protocols.clj │ │ ├── core_clr.clj │ │ ├── core_deftype.clj │ │ ├── core_print.clj │ │ ├── core_proxy.clj │ │ ├── data.clj │ │ ├── dm-test.clj │ │ ├── genclass.clj │ │ ├── gvec.clj │ │ ├── main.clj │ │ ├── pprint.clj │ │ ├── pprint │ │ ├── cl_format.clj │ │ ├── column_writer.clj │ │ ├── dispatch.clj │ │ ├── pprint_base.clj │ │ ├── pretty_writer.clj │ │ ├── print_table.clj │ │ └── utilities.clj │ │ ├── reflect.clj │ │ ├── reflect │ │ └── clr.clj │ │ ├── repl.clj │ │ ├── run_tests.clj │ │ ├── run_tests_i.clj │ │ ├── samples │ │ ├── ants.clj │ │ ├── attributes │ │ │ ├── C.cs │ │ │ ├── C.dll │ │ │ └── testattribute.clj │ │ ├── await-test.clj │ │ ├── celsius.clj │ │ ├── counter.clj │ │ ├── deftype │ │ │ ├── testdeftype.clj │ │ │ └── testprotocol.clj │ │ ├── genclass │ │ │ ├── C.cs │ │ │ ├── testgenclass.clj │ │ │ ├── testgenclass2.clj │ │ │ ├── testgenclass3.clj │ │ │ └── testmvc.clj │ │ ├── interop │ │ │ ├── C.cs │ │ │ ├── C.dll │ │ │ └── testinterop.clj │ │ ├── proxy │ │ │ └── testproxy.clj │ │ └── stm │ │ │ └── teststm.clj │ │ ├── set.clj │ │ ├── stacktrace.clj │ │ ├── string.clj │ │ ├── template.clj │ │ ├── test.clj │ │ ├── test │ │ ├── junit.clj │ │ └── tap.clj │ │ ├── test_clojure │ │ ├── agents.clj │ │ ├── atoms.clj │ │ ├── clojure_set.clj │ │ ├── clojure_walk.clj │ │ ├── clojure_xml.clj │ │ ├── clojure_zip.clj │ │ ├── clr │ │ │ └── io.clj │ │ ├── compilation.clj │ │ ├── control.clj │ │ ├── data.clj │ │ ├── data_structures.clj │ │ ├── def.clj │ │ ├── errors.clj │ │ ├── evaluation.clj │ │ ├── for.clj │ │ ├── genclass.clj │ │ ├── genclass │ │ │ └── examples.clj │ │ ├── java_interop.clj │ │ ├── keywords.clj │ │ ├── load.clj │ │ ├── load │ │ │ ├── cyclic0.clj │ │ │ ├── cyclic1.clj │ │ │ ├── cyclic2.clj │ │ │ ├── cyclic3.clj │ │ │ ├── cyclic4.clj │ │ │ ├── cyclic5.clj │ │ │ └── cyclic6.clj │ │ ├── logic.clj │ │ ├── macros.clj │ │ ├── main.clj │ │ ├── metadata.clj │ │ ├── multimethods.clj │ │ ├── ns_libs.clj │ │ ├── numbers.clj │ │ ├── other_functions.clj │ │ ├── parallel.clj │ │ ├── pprint.clj │ │ ├── pprint │ │ │ ├── test_cl_format.clj │ │ │ ├── test_helper.clj │ │ │ └── test_pretty.clj │ │ ├── predicates.clj │ │ ├── printer.clj │ │ ├── protocols.clj │ │ ├── protocols │ │ │ ├── examples.clj │ │ │ ├── hash_collisions.clj │ │ │ └── more_examples.clj │ │ ├── reader.clj │ │ ├── refs.clj │ │ ├── repl.clj │ │ ├── repl │ │ │ └── example.clj │ │ ├── rt.clj │ │ ├── sequences.clj │ │ ├── serialization.clj │ │ ├── special.clj │ │ ├── string.clj │ │ ├── test.clj │ │ ├── test_fixtures.clj │ │ ├── transients.clj │ │ ├── vars.clj │ │ └── vectors.clj │ │ ├── test_helper.clj │ │ ├── walk.clj │ │ └── zip.clj ├── Clojure.Tests │ ├── Clojure.Tests.csproj │ ├── FixtureSetupClass.cs │ ├── LibTests │ │ ├── AFnImplTests.cs │ │ ├── APersistentVectorTests.cs │ │ ├── ARefTests.cs │ │ ├── AReferenceTests.cs │ │ ├── AgentTests.cs │ │ ├── ArraySeqTests.cs │ │ ├── ArrayStreamTests.cs │ │ ├── AtomTests.cs │ │ ├── BigDecimalTests.cs │ │ ├── BigIntegerTests.cs │ │ ├── CachedSeqTests.cs │ │ ├── ConsTests.cs │ │ ├── CountDownLatchTests.cs │ │ ├── DelayTests.cs │ │ ├── DummyFn.cs │ │ ├── DummyMeta.cs │ │ ├── EnumeratorSeqTests.cs │ │ ├── FutureTests.cs │ │ ├── GenProxyTests.cs │ │ ├── IObjTests.cs │ │ ├── ISeqTestHelper.cs │ │ ├── IteratorStreamTests.cs │ │ ├── KeywordTests.cs │ │ ├── LazilyPersistentVectorTests.cs │ │ ├── LazySeqTests.cs │ │ ├── LispReaderTests.cs │ │ ├── LockingTransactionTests.cs │ │ ├── MapEntryTests.cs │ │ ├── NamespaceTests.cs │ │ ├── NumbersTests.cs │ │ ├── ObjTests.cs │ │ ├── PersistentArrayMapTests.cs │ │ ├── PersistentHashMapTests.cs │ │ ├── PersistentHashSetTests.cs │ │ ├── PersistentListTests.cs │ │ ├── PersistentQueueTests.cs │ │ ├── PersistentStructMapTests.cs │ │ ├── PersistentTreeMapTests.cs │ │ ├── PersistentTreeSetTests.cs │ │ ├── PersistentVectorTests.cs │ │ ├── PrintfTests.cs │ │ ├── RangeTests.cs │ │ ├── RatioTests.cs │ │ ├── RefTests.cs │ │ ├── RestFnImplTests.cs │ │ ├── RestFnTests.cs │ │ ├── StreamTests.cs │ │ ├── StringSeqTests.cs │ │ ├── SymbolTests.cs │ │ └── TestTest.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ReaderTests │ │ └── LineNumberingTextReaderTests.cs │ └── packages.config ├── Clojure │ ├── Bootstrap │ │ ├── ants.clj │ │ ├── core.clj │ │ ├── core_print.clj │ │ ├── main.clj │ │ ├── set.clj │ │ ├── test.clj │ │ ├── version.properties │ │ └── zip.clj │ ├── CljCompiler │ │ ├── Ast │ │ │ ├── AFnImplGenerator.cs │ │ │ ├── AssignExpr.cs │ │ │ ├── AssignableExpr.cs │ │ │ ├── BindingInit.cs │ │ │ ├── BodyExpr.cs │ │ │ ├── BooleanExpr.cs │ │ │ ├── CaseExpr.cs │ │ │ ├── ConstantExpr.cs │ │ │ ├── DefExpr.cs │ │ │ ├── DynInitHelper.cs │ │ │ ├── EmptyExpr.cs │ │ │ ├── Expr.cs │ │ │ ├── FieldExpr.cs │ │ │ ├── FnExpr.cs │ │ │ ├── FnMethod.cs │ │ │ ├── GenContext.cs │ │ │ ├── HostArg.cs │ │ │ ├── HostExpr.cs │ │ │ ├── IParser.cs │ │ │ ├── IdentityHashMap.cs │ │ │ ├── IfExpr.cs │ │ │ ├── ImportExpr.cs │ │ │ ├── InstanceFieldExpr.cs │ │ │ ├── InstanceMethodExpr.cs │ │ │ ├── InstanceOfExpr.cs │ │ │ ├── InstanceZeroArityCallExpr.cs │ │ │ ├── IntrinsicsRewriter.cs │ │ │ ├── InvokeExpr.cs │ │ │ ├── KeywordExpr.cs │ │ │ ├── KeywordInvokeExpr.cs │ │ │ ├── LetExpr.cs │ │ │ ├── LetFnExpr.cs │ │ │ ├── LiteralExpr.cs │ │ │ ├── LocalBinding.cs │ │ │ ├── LocalBindingExpr.cs │ │ │ ├── MapExpr.cs │ │ │ ├── MaybePrimitiveExpr.cs │ │ │ ├── MetaExpr.cs │ │ │ ├── MethodExpr.cs │ │ │ ├── MethodParamExpr.cs │ │ │ ├── MonitorEnterExpr.cs │ │ │ ├── MonitorExitExpr.cs │ │ │ ├── NewExpr.cs │ │ │ ├── NewInstanceExpr.cs │ │ │ ├── NewInstanceMethod.cs │ │ │ ├── NilExpr.cs │ │ │ ├── Node.cs │ │ │ ├── NumberExpr.cs │ │ │ ├── ObjExpr.cs │ │ │ ├── ObjMethod.cs │ │ │ ├── ParseException.cs │ │ │ ├── ParserContext.cs │ │ │ ├── RecurExpr.cs │ │ │ ├── SetExpr.cs │ │ │ ├── StaticFieldExpr.cs │ │ │ ├── StaticInvokeExpr.cs │ │ │ ├── StaticMethodExpr.cs │ │ │ ├── StringExpr.cs │ │ │ ├── TheVarExpr.cs │ │ │ ├── ThrowExpr.cs │ │ │ ├── TryExpr.cs │ │ │ ├── UnresolvedVarExpr.cs │ │ │ ├── UntypedExpr.cs │ │ │ ├── VarExpr.cs │ │ │ └── VectorExpr.cs │ │ ├── Compiler.cs │ │ ├── GenClass.cs │ │ ├── GenDelegate.cs │ │ ├── GenInterface.cs │ │ ├── GenProxy.cs │ │ └── MethodSignature.cs │ ├── Clojure.csproj │ ├── GlobalSuppressions.cs │ ├── Lib │ │ ├── AFn.cs │ │ ├── AFnImpl.cs │ │ ├── AFunction.cs │ │ ├── AMapEntry.cs │ │ ├── APersistentMap.cs │ │ ├── APersistentSet.cs │ │ ├── APersistentVector.cs │ │ ├── ARef.cs │ │ ├── AReference.cs │ │ ├── ASeq.cs │ │ ├── ATransientMap.cs │ │ ├── ATransientSet.cs │ │ ├── Agent.cs │ │ ├── ArityException.cs │ │ ├── ArrayChunk.cs │ │ ├── ArrayHelper.cs │ │ ├── ArraySeq.cs │ │ ├── Associative.cs │ │ ├── Atom.cs │ │ ├── AtomicBoolean.cs │ │ ├── AtomicInteger.cs │ │ ├── AtomicLong.cs │ │ ├── AtomicReference.cs │ │ ├── BigDecimal.cs │ │ ├── BigInt.cs │ │ ├── BigInteger.cs │ │ ├── Box.cs │ │ ├── ChunkBuffer.cs │ │ ├── ChunkedCons.cs │ │ ├── ClojureException.cs │ │ ├── Cons.cs │ │ ├── CountDownLatch.cs │ │ ├── Counted.cs │ │ ├── Delay.cs │ │ ├── EnumeratorSeq.cs │ │ ├── Fn.cs │ │ ├── FuncTypes.cs │ │ ├── Future.cs │ │ ├── IBlockingDeref.cs │ │ ├── IChunk.cs │ │ ├── IChunkedSeq.cs │ │ ├── IDeref.cs │ │ ├── IEditableCollection.cs │ │ ├── IFn.cs │ │ ├── IFnArity.cs │ │ ├── IHashEq.cs │ │ ├── IKeywordLookup.cs │ │ ├── ILookup.cs │ │ ├── ILookupSite.cs │ │ ├── ILookupThunk.cs │ │ ├── IMapEntry.cs │ │ ├── IMeta.cs │ │ ├── IObj.cs │ │ ├── IPending.cs │ │ ├── IPersistentCollection.cs │ │ ├── IPersistentList.cs │ │ ├── IPersistentMap.cs │ │ ├── IPersistentSet.cs │ │ ├── IPersistentStack.cs │ │ ├── IPersistentVector.cs │ │ ├── IProxy.cs │ │ ├── IRecord.cs │ │ ├── IReduce.cs │ │ ├── IRef.cs │ │ ├── IReference.cs │ │ ├── ISeq.cs │ │ ├── ITransientAssociative.cs │ │ ├── ITransientCollection.cs │ │ ├── ITransientMap.cs │ │ ├── ITransientSet.cs │ │ ├── ITransientVector.cs │ │ ├── IType.cs │ │ ├── Indexed.cs │ │ ├── IndexedSeq.cs │ │ ├── JReMatcher.cs │ │ ├── JavaConcurrentDictionary.cs │ │ ├── Keyword.cs │ │ ├── KeywordLookupSite.cs │ │ ├── LazilyPersistentVector.cs │ │ ├── LazySeq.cs │ │ ├── LispReader.cs │ │ ├── LockingTransaction.cs │ │ ├── MapEntry.cs │ │ ├── MapEnumerator.cs │ │ ├── MapEquivalence.cs │ │ ├── MethodImplCache.cs │ │ ├── MultiFn.cs │ │ ├── Named.cs │ │ ├── Namespace.cs │ │ ├── Numbers.cs │ │ ├── Obj.cs │ │ ├── PersistentArrayMap.cs │ │ ├── PersistentHashMap.cs │ │ ├── PersistentHashSet.cs │ │ ├── PersistentList.cs │ │ ├── PersistentQueue.cs │ │ ├── PersistentStructMap.cs │ │ ├── PersistentTreeMap.cs │ │ ├── PersistentTreeSet.cs │ │ ├── PersistentVector.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── RT.cs │ │ ├── Range.cs │ │ ├── Ratio.cs │ │ ├── Ref.cs │ │ ├── RestFn.cs │ │ ├── RestFnImpl.cs │ │ ├── Reversible.cs │ │ ├── SeqEnumerator.cs │ │ ├── Seqable.cs │ │ ├── Sequential.cs │ │ ├── Settable.cs │ │ ├── Sorted.cs │ │ ├── StringSeq.cs │ │ ├── Symbol.cs │ │ ├── Util.cs │ │ └── Var.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── Readers │ │ ├── LineNumberingTextReader.cs │ │ └── PushbackTextReader.cs │ ├── Resources │ │ └── version.txt │ ├── Runtime │ │ ├── Binding │ │ │ ├── BindingHelpers.cs │ │ │ ├── ClojureBinder.cs │ │ │ ├── ClojureConversionBinder.cs │ │ │ ├── ClojureCreateInstanceBinder.cs │ │ │ ├── ClojureGetZeroArityMemberBinder.cs │ │ │ ├── ClojureInvokeMemberBinder.cs │ │ │ ├── ClojureOverloadResolver.cs │ │ │ ├── DynUtils.cs │ │ │ ├── IClojureConvertible.cs │ │ │ ├── IClojureSite.cs │ │ │ └── MetaAFn.cs │ │ ├── ClojureContext.cs │ │ ├── ClojureOps.cs │ │ ├── ClojureOptions.cs │ │ ├── Converter.cs │ │ ├── ImmutableDictionaryEnumerator.cs │ │ ├── Printf.cs │ │ ├── Properties.cs │ │ └── Reflector.cs │ ├── app.config │ └── packages.config ├── ClojureCLR.sln ├── DlrConsole │ ├── App.config │ ├── DlrConsole.csproj │ ├── Program.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── Simple.Console │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Simple.Console.csproj │ └── SimpleConsole.cs └── build.proj ├── FxCop ├── Clojure.FxCop └── CustomDictionary.xml ├── changes.md ├── docs ├── CompilerContextAnalysis.xlsx ├── CompilerInternalsQuestion-2009-09-07.txt ├── Simple-JVM-CLR-comparison.docx ├── TestJavaFormat │ ├── build.xml │ ├── build │ │ └── classes │ │ │ └── .netbeans_automatic_build │ ├── manifest.mf │ ├── nbproject │ │ ├── build-impl.xml │ │ ├── genfiles.properties │ │ ├── private │ │ │ └── private.properties │ │ ├── project.properties │ │ └── project.xml │ └── src │ │ └── testjavaformat │ │ └── Main.java ├── new-issues-2009-10-04.txt ├── pprint │ ├── CommonLispFormat.markdown │ └── PrettyPrinting.markdown ├── proxy-samples.clj.txt └── radix.xlsx ├── epl-v10.html ├── lib └── DLR │ ├── 2.0 │ └── License.html │ └── 4.0 │ └── License.html └── readme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | #Visual Studio artifacts 2 | bin 3 | obj 4 | *.user 5 | *.suo 6 | # Emacs artifacts 7 | *~ 8 | # Java artifacts 9 | *.class 10 | # lib 11 | lib/*/*.dll 12 | lib/*/*.xml 13 | lib/*/*.pdb 14 | lib/*/*/*.dll 15 | lib/*/*/*.xml 16 | lib/*/*/*.pdb 17 | # NuGet packages 18 | */packages/* 19 | -------------------------------------------------------------------------------- /Clojure/Clojure.Compile/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Diagnostics.CodeAnalysis; 17 | 18 | 19 | // TODO: Determine if we want to make Clojure.dll CLSCompliant 20 | 21 | [assembly: CLSCompliant(false)] 22 | 23 | // TODO: Consider implications of strong-signing (has been requested by people who want to install in the GAC) 24 | [assembly: SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")] 25 | -------------------------------------------------------------------------------- /Clojure/Clojure.Compile/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("BootstrapCompile")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("BootstrapCompile")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5cd7f55f-06b5-4520-af3e-936776803b57")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Clojure/Clojure.Main/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Diagnostics.CodeAnalysis; 17 | 18 | 19 | // TODO: Determine if we want to make Clojure.dll CLSCompliant 20 | 21 | [assembly: CLSCompliant(false)] 22 | 23 | // TODO: Consider implications of strong-signing (has been requested by people who want to install in the GAC) 24 | [assembly: SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")] 25 | -------------------------------------------------------------------------------- /Clojure/Clojure.Main/Main.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using clojure.lang; 20 | 21 | namespace Clojure 22 | { 23 | public static class CljMain 24 | { 25 | private static readonly Symbol CLOJURE_MAIN = Symbol.intern("clojure.main"); 26 | private static readonly Var REQUIRE = RT.var("clojure.core", "require"); 27 | private static readonly Var LEGACY_REPL = RT.var("clojure.main", "legacy-repl"); 28 | private static readonly Var LEGACY_SCRIPT = RT.var("clojure.main", "legacy-script"); 29 | private static readonly Var MAIN = RT.var("clojure.main", "main"); 30 | 31 | static void Main(string[] args) 32 | { 33 | REQUIRE.invoke(CLOJURE_MAIN); 34 | MAIN.applyTo(RT.seq(args)); 35 | } 36 | 37 | static void legacy_repl(string[] args) 38 | { 39 | REQUIRE.invoke(CLOJURE_MAIN); 40 | LEGACY_REPL.invoke(RT.seq(args)); 41 | 42 | } 43 | 44 | static void legacy_script(string[] args) 45 | { 46 | REQUIRE.invoke(CLOJURE_MAIN); 47 | LEGACY_SCRIPT.invoke(RT.seq(args)); 48 | } 49 | 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Clojure/Clojure.Main/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Clojure.Main")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Clojure.Main")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0d3ce997-8d0d-40c6-b116-a3d2f006b912")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Clojure/Clojure.Main/clojure-icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richhickey/clojure-clr/2c7e20cd3c6ffc64b783ddb3cb7984fb93472ad4/Clojure/Clojure.Main/clojure-icon.ico -------------------------------------------------------------------------------- /Clojure/Clojure.Main/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/dm-test.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) David Miller. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | 10 | (ns clojure.test) 11 | 12 | ; check generation of boolean test when test is known to be of type bool. 13 | 14 | (defn test-if [i n] ( if (> i n) 'a 'b)) 15 | 16 | ; check generation of boolean test when test type is not known. 17 | 18 | (defn test-if2-test [i n] (> i n)) 19 | (defn test-if2 [i n] (if (test-if2-test i n) 'a 'b)) 20 | 21 | ; check generation of boolean test when return type is not bool. 22 | (defn test-if3 [i n] (if i n 'b)) 23 | 24 | 25 | ; basic check of type tagging from the Clojure docs: 26 | (defn len [x] (. x Length)) 27 | (defn len2 [^String x] (. x Length)) 28 | 29 | (defn test-len [] (time (reduce + (map len (replicate 10000 "asdf"))))) 30 | (defn test-len2 [] (time (reduce + (map len2 (replicate 10000 "asdf"))))) 31 | 32 | ; my first test ever. It still runs slow 33 | (defn f1 [l n] (if (> (count l) n) nil (recur (cons 'a l) n))) 34 | (defn test-f1 [] (time (f1 nil 10000))) 35 | 36 | (defn f-dotimes [n] (dotimes [i n] (list i))) 37 | (defn test-dotimes [] (time (f-dotimes 100000))) 38 | 39 | 40 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/pprint.clj: -------------------------------------------------------------------------------- 1 | ;;; pprint.clj -- Pretty printer and Common Lisp compatible format function (cl-format) for Clojure 2 | 3 | ; Copyright (c) Rich Hickey. All rights reserved. 4 | ; The use and distribution terms for this software are covered by the 5 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 6 | ; which can be found in the file epl-v10.html at the root of this distribution. 7 | ; By using this software in any fashion, you are agreeing to be bound by 8 | ; the terms of this license. 9 | ; You must not remove this notice, or any other, from this software. 10 | 11 | ;; Author: Tom Faulhaber 12 | ;; April 3, 2009 13 | 14 | (ns 15 | ^{:author "Tom Faulhaber", 16 | :doc "A Pretty Printer for Clojure 17 | 18 | clojure.pprint implements a flexible system for printing structured data 19 | in a pleasing, easy-to-understand format. Basic use of the pretty printer is 20 | simple, just call pprint instead of println. More advanced users can use 21 | the building blocks provided to create custom output formats. 22 | 23 | Out of the box, pprint supports a simple structured format for basic data 24 | and a specialized format for Clojure source code. More advanced formats, 25 | including formats that don't look like Clojure data at all like XML and 26 | JSON, can be rendered by creating custom dispatch functions. 27 | 28 | In addition to the pprint function, this module contains cl-format, a text 29 | formatting function which is fully compatible with the format function in 30 | Common Lisp. Because pretty printing directives are directly integrated with 31 | cl-format, it supports very concise custom dispatch. It also provides 32 | a more powerful alternative to Clojure's standard format function. 33 | 34 | See documentation for pprint and cl-format for more information or 35 | complete documentation on the the clojure web site on github.", 36 | :added "1.2"} 37 | clojure.pprint 38 | (:refer-clojure :exclude (deftype)) 39 | (:use [clojure.walk :only [walk]])) 40 | 41 | 42 | (load "pprint/utilities") 43 | (load "pprint/column_writer") 44 | (load "pprint/pretty_writer") 45 | (load "pprint/pprint_base") 46 | (load "pprint/cl_format") 47 | (load "pprint/dispatch") 48 | (load "pprint/print_table") 49 | 50 | nil 51 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/pprint/print_table.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | (in-ns 'clojure.pprint) 10 | 11 | (defn print-table 12 | "Alpha - subject to change. 13 | Prints a collection of maps in a textual table. Prints table headings 14 | ks, and then a line of output for each row, corresponding to the keys 15 | in ks. If ks are not specified, use the keys of the first item in rows." 16 | {:added "1.3"} 17 | ([ks rows] 18 | (when (seq rows) 19 | (let [widths (map 20 | (fn [k] 21 | (apply max (count (str k)) (map #(count (str (get % k))) rows))) 22 | ks) 23 | fmts (map #(str "%-" % "s") widths) 24 | fmt-row (fn [row] 25 | (apply str (interpose " | " 26 | (for [[col fmt] (map vector (map #(get row %) ks) fmts)] 27 | (format fmt (str col)))))) 28 | header (fmt-row (zipmap ks ks)) 29 | bar (apply str (repeat (count header) "="))] 30 | (println bar) 31 | (println header) 32 | (println bar) 33 | (doseq [row rows] 34 | (println (fmt-row row))) 35 | (println bar)))) 36 | ([rows] (print-table (keys (first rows)) rows))) 37 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/run_tests.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.test-clojure (:require clojure.test)) 2 | 3 | (def test-namespaces '[ 4 | clojure.test-clojure.agents 5 | ;;;clojure.test-clojure.annotations 6 | clojure.test-clojure.atoms 7 | clojure.test-clojure.clojure-set 8 | clojure.test-clojure.clojure-walk 9 | ;;;clojure.test-clojure.clojure-xml 10 | clojure.test-clojure.clojure-zip 11 | clojure.test-clojure.compilation 12 | clojure.test-clojure.control 13 | clojure.test-clojure.data 14 | clojure.test-clojure.data-structures 15 | clojure.test-clojure.def 16 | clojure.test-clojure.errors 17 | clojure.test-clojure.evaluation 18 | clojure.test-clojure.for 19 | clojure.test-clojure.genclass.examples ;;; ? 20 | clojure.test-clojure.genclass 21 | clojure.test-clojure.clr.io ;;;java.io 22 | ;;;clojure.test-clojure.java.javadoc 23 | ;;;clojure.test-clojure.java.shell 24 | clojure.test-clojure.java-interop 25 | clojure.test-clojure.keywords 26 | clojure.test-clojure.load 27 | clojure.test-clojure.logic 28 | clojure.test-clojure.macros 29 | clojure.test-clojure.main 30 | clojure.test-clojure.metadata 31 | clojure.test-clojure.multimethods 32 | clojure.test-clojure.ns-libs 33 | clojure.test-clojure.numbers 34 | clojure.test-clojure.other-functions 35 | clojure.test-clojure.parallel 36 | clojure.test-clojure.pprint 37 | clojure.test-clojure.predicates 38 | clojure.test-clojure.printer 39 | clojure.test-clojure.protocols 40 | clojure.test-clojure.protocols.hash-collisions 41 | clojure.test-clojure.reader 42 | ;;; clojure.test-clojure.reflect -- TODO: need to rewrite reflect tests 43 | clojure.test-clojure.refs 44 | clojure.test-clojure.repl 45 | clojure.test-clojure.rt 46 | clojure.test-clojure.sequences 47 | clojure.test-clojure.serialization 48 | clojure.test-clojure.special 49 | clojure.test-clojure.string 50 | clojure.test-clojure.test 51 | clojure.test-clojure.test-fixtures 52 | clojure.test-clojure.transients 53 | clojure.test-clojure.vars 54 | clojure.test-clojure.vectors 55 | ]) 56 | 57 | (apply require test-namespaces) 58 | 59 | (let [results (apply clojure.test/run-tests test-namespaces)] 60 | (Environment/Exit (+ (:error results) (:fail results)))) ;;; System/exit 61 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/run_tests_i.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.test-clojure (:require clojure.test)) 2 | 3 | (def test-namespaces '[ 4 | clojure.test-clojure.agents 5 | ;;;clojure.test-clojure.annotations 6 | clojure.test-clojure.atoms 7 | clojure.test-clojure.clojure-set 8 | clojure.test-clojure.clojure-walk 9 | ;;;clojure.test-clojure.clojure-xml 10 | clojure.test-clojure.clojure-zip 11 | clojure.test-clojure.compilation 12 | clojure.test-clojure.control 13 | clojure.test-clojure.data 14 | clojure.test-clojure.data-structures 15 | clojure.test-clojure.def 16 | clojure.test-clojure.errors 17 | clojure.test-clojure.evaluation 18 | clojure.test-clojure.for 19 | clojure.test-clojure.genclass.examples ;;; ? 20 | clojure.test-clojure.genclass 21 | clojure.test-clojure.clr.io ;;;java.io 22 | ;;;clojure.test-clojure.java.javadoc 23 | ;;;clojure.test-clojure.java.shell 24 | clojure.test-clojure.java-interop 25 | clojure.test-clojure.keywords 26 | clojure.test-clojure.load 27 | clojure.test-clojure.logic 28 | clojure.test-clojure.macros 29 | clojure.test-clojure.main 30 | clojure.test-clojure.metadata 31 | clojure.test-clojure.multimethods 32 | clojure.test-clojure.ns-libs 33 | clojure.test-clojure.numbers 34 | clojure.test-clojure.other-functions 35 | clojure.test-clojure.parallel 36 | clojure.test-clojure.pprint 37 | clojure.test-clojure.predicates 38 | clojure.test-clojure.printer 39 | clojure.test-clojure.protocols 40 | clojure.test-clojure.protocols.hash-collisions 41 | clojure.test-clojure.reader 42 | ;;; clojure.test-clojure.reflect -- TODO: need to rewrite reflect tests 43 | clojure.test-clojure.refs 44 | clojure.test-clojure.repl 45 | clojure.test-clojure.rt 46 | clojure.test-clojure.sequences 47 | clojure.test-clojure.serialization 48 | clojure.test-clojure.special 49 | clojure.test-clojure.string 50 | clojure.test-clojure.test 51 | clojure.test-clojure.test-fixtures 52 | clojure.test-clojure.transients 53 | clojure.test-clojure.vars 54 | clojure.test-clojure.vectors 55 | ]) 56 | 57 | (apply require test-namespaces) 58 | 59 | (let [results (apply clojure.test/run-tests test-namespaces)] 60 | (print (+ (:error results) (:fail results)))) ;;;(Environment/Exit (+ (:error results) (:fail results)))) ;;; System/exit 0 61 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/attributes/C.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace dm 7 | { 8 | // stolen mostly from the MS docs on System.Attribute 9 | 10 | public enum Pet 11 | { 12 | Unknown, 13 | Dog, 14 | Cat, 15 | Bird 16 | } 17 | 18 | public class PetTypeAttribute : Attribute 19 | { 20 | private Pet _pet; 21 | 22 | protected Pet ThePet 23 | { 24 | get { return _pet; } 25 | set { _pet = value; } 26 | } 27 | 28 | public PetTypeAttribute(Pet pet) 29 | { 30 | _pet = pet; 31 | } 32 | 33 | public override string ToString() 34 | { 35 | return String.Format("", _pet.ToString()); 36 | } 37 | 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/attributes/C.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richhickey/clojure-clr/2c7e20cd3c6ffc64b783ddb3cb7984fb93472ad4/Clojure/Clojure.Source/clojure/samples/attributes/C.dll -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/attributes/testattribute.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: David Miller 10 | 11 | ; Test of gen-class facility. 12 | ; 13 | ; Place this file in the clojure subdirectory of your main directory. 14 | ; Compile the file C.cs via: csc /t:library C.cs 15 | ; Place C.dll in your root directory. 16 | ; Start Clojure and do: 17 | ; (System.Reflection.Assembly/LoadFrom "C.dll") 18 | ; (compile 'clojure.testattribute) 19 | ; 20 | ; You should then be able to play games such as: 21 | 22 | (ns clojure.testattribute) 23 | 24 | (def x (dm.Pet/Dog)) 25 | 26 | (gen-interface 27 | :name ^{System.SerializableAttribute {} dm.PetTypeAttribute x} test.I1 28 | :methods [ [m1 [] Object] ]) 29 | 30 | (definterface ^{System.SerializableAttribute {} dm.PetTypeAttribute x} I2 (m2 [])) 31 | 32 | ; (seq (.GetCustomAttributes test.I1 true)) 33 | ; (seq (.GetCustomAttributes I2 true)) 34 | 35 | 36 | (definterface ^{ dm.PetTypeAttribute x } I3 37 | (^{ dm.PetTypeAttribute x } m1 [ x y]) 38 | (m2 [x ^{ dm.PetTypeAttribute x } y])) 39 | 40 | 41 | (deftype ^{System.SerializableAttribute {}} T1 [a ^{ dm.PetTypeAttribute x } b] 42 | I3 43 | (^{ dm.PetTypeAttribute x } m1 [_ p q] p) 44 | (m2 [_ p ^{ dm.PetTypeAttribute x } q] q) 45 | ) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/await-test.clj: -------------------------------------------------------------------------------- 1 | ; Simple test for await 2 | ; Eventually should put in test framework 3 | 4 | (def counter (ref 0)) 5 | 6 | (defn work [state] 7 | (System.Threading.Thread/Sleep 1000) 8 | (dosync (commute counter inc)) 9 | true) 10 | 11 | (def agents (for [x (range 10)] (agent nil))) 12 | 13 | (defn doit [] 14 | (doall (map #(send % work) agents)) 15 | (apply await agents) 16 | [@counter (doall (map deref agents))]) 17 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/celsius.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) David Miller. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | 10 | ;;; A Celsius/Fahrenheit converter 11 | ;;; A WinForms equivalent to the Swing app shown here: http://clojure.org/jvm_hosted 12 | 13 | ; If you are running on .Net 4, you will have to change this. 14 | (System.Reflection.Assembly/Load "System.Windows.Forms,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") 15 | 16 | (import 17 | '(System.Drawing Size) 18 | '(System.Windows.Forms 19 | Form TableLayoutPanel Label Button TextBox 20 | PaintEventHandler PaintEventArgs) 21 | ) 22 | 23 | 24 | (defn celsius [] 25 | (let [form (Form.) 26 | panel (TableLayoutPanel.) 27 | p-controls (.Controls panel) 28 | tb (TextBox.) 29 | c-label (Label.) 30 | button (Button.) 31 | f-label (Label.)] 32 | 33 | (.set_Text form "Celsius Converter") 34 | (.set_Text c-label "Celsius") 35 | (.set_Text f-label "Fahrenheit") 36 | (.set_Text button "Convert") 37 | 38 | (.. form (Controls) (Add panel)) 39 | 40 | (.add_Click button 41 | (gen-delegate EventHandler [sender args] 42 | (let [c (Double/Parse (.Text tb)) ] 43 | (.set_Text f-label (str (+ 32 (* 1.8 c)) " Fahrenheit"))))) 44 | 45 | (doto panel 46 | (.set_ColumnCount 2) 47 | (.set_RowCount 2)) 48 | 49 | (doto p-controls 50 | (.Add tb) 51 | (.Add c-label) 52 | (.Add button) 53 | (.Add f-label)) 54 | 55 | (doto form 56 | (.set_Size (Size. 300 120)) 57 | .ShowDialog))) 58 | 59 | 60 | (celsius) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/counter.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.samples.counter) 2 | 3 | (defn tt [x y] (clojure.lang.Util/identical x y)) 4 | 5 | (def s (apply str (repeat 20 "This is a really long string"))) 6 | 7 | (set! *unchecked-math* true) 8 | 9 | (defn count-num-chars ^long [^String s] 10 | (let [l (.Length s) 11 | c \space] 12 | (loop [i 0 acc 0] 13 | (if (< i l) 14 | (recur (inc i) 15 | (if (identical? (.get_Chars s i) c) acc 16 | (inc acc))) 17 | acc)))) 18 | 19 | 20 | (defn cnc [n] 21 | (dotimes [_ n] (count-num-chars s))) 22 | 23 | (defn f [] 24 | (let [sw (System.Diagnostics.Stopwatch.) 25 | nanosec-per-tick (/ 1000000000 System.Diagnostics.Stopwatch/Frequency)] 26 | (.Start sw) 27 | (dotimes [_ 1000] 28 | (count-num-chars s)) 29 | (.Stop sw) 30 | (println "Time (nsec): " (* (.ElapsedTicks sw) nanosec-per-tick)))) 31 | 32 | (defn g [n] 33 | (time (cnc n))) 34 | 35 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/deftype/testprotocol.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.testprotocol) 2 | 3 | (defprotocol P1 (m1 [x])) 4 | 5 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/genclass/C.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace dm 7 | { 8 | public class C1 9 | { 10 | protected int x = 0; 11 | protected string y = String.Empty; 12 | 13 | public void m1(int x) { Message("m1", x.ToString()); } 14 | 15 | public int m2(int x, string y) { Message("m2", x.ToString(), y); return x + y.Length; } 16 | public int m2(int x) { Message("m2", x.ToString()); return 2 * x; } 17 | 18 | 19 | protected int m3(object y) { Message("m3", y.ToString()); return y.GetHashCode(); } 20 | protected int m3(int x) { Message("m3", x.ToString()); return x + 1; } 21 | 22 | protected int m4(int x) { Message("m4", x.ToString()); return x + 1; } 23 | private int m5(int x) { Message("m5", x.ToString()); return x + 1; } 24 | 25 | public C1(int x, string y) { Message("ctor1", x.ToString(), y); this.x = x; this.y = y; } 26 | protected C1(string y, int x) { Message("ctor2", y, x.ToString()); this.y = y; this.x = x; } 27 | public C1() { Message("defaultctor"); } 28 | 29 | private static void Message(string name, params string[] strs) 30 | { 31 | Console.WriteLine("In {0}: {1}", name, string.Join(", ", strs)); 32 | } 33 | } 34 | 35 | public interface I1 36 | { 37 | object m5(object x); 38 | int m2(string x); 39 | int m2(int x); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/genclass/testgenclass.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: David Miller 10 | 11 | ; Test of gen-class facility. 12 | ; 13 | ; Place this file in the clojure subdirectory of your main directory. 14 | ; Compile the file C.cs via: csc /t:library C.cs 15 | ; Place C.dll in your root directory. 16 | ; Start Clojure and do: 17 | ; (System.Reflection.Assembly/LoadFrom "C.dll") 18 | ; (compile 'clojure.testgenclass) 19 | ; 20 | ; You should then be able to play games such as: 21 | ; 22 | ; (def v (test.my.gen/fy 12 "test" "thingy")) 23 | ; (.m2 v 12) 24 | ; (.State v) 25 | ; (.getx v) 26 | ; (.setx v 99) 27 | ; (.getx v) 28 | ; 29 | ; Also, you should be able to go to your root directory and execute test.my.gen.exe. 30 | ; It will load everything and call the main routine listed below. 31 | 32 | (gen-interface :name test.my.I2 33 | :methods [ [m10 [Int32 String] Int32] ]) 34 | 35 | (ns clojure.testgenclass 36 | (:gen-class 37 | :name test.my.gen 38 | :main true 39 | :implements [ dm.I1 test.my.I2 ] 40 | :extends dm.C1 41 | :factory fy 42 | :init init 43 | :post-init pinit 44 | :state State 45 | :constructors {[Int32 String Object][String Int32]} 46 | :methods [ [f [Object] Object] [g [Int32] Int32] ] 47 | :exposes { x { :get getx :set setx } } 48 | :exposes-methods { m4 do-m4 } 49 | ) 50 | ) 51 | 52 | 53 | (defn -init [x y z] [[y x] z]) 54 | 55 | (defn -pinit [this x y z] nil) 56 | 57 | (defn -f [x] x) 58 | (defn -g [x] (inc x)) 59 | 60 | (defn -main [& args] 61 | (let [ v (test.my.gen/fy 12 "test" "thingy")] 62 | (println (str (.State v))))) 63 | 64 | 65 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/genclass/testgenclass2.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; 10 | ; Author: David Miller 11 | ; 12 | ; A simple test of the gen-class facility taking defaults for all. 13 | ; 14 | ; 15 | ; Place this file in the clojure subdirectory of your main directory. 16 | ; (compile 'clojure.testgenclass2) 17 | ; 18 | ; You should then find clojure.testgenclass2.exe in your compile path. 19 | ; Executing it should print "Hello, world". 20 | 21 | 22 | (ns clojure.testgenclass2 23 | (:gen-class)) 24 | 25 | 26 | (defn -main [] 27 | (println "Hello, world")) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/genclass/testgenclass3.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; 10 | ; Author: David Miller 11 | ; 12 | ; Simple example testing arguments and returns of value type. 13 | ; 14 | ; Place this file in the clojure subdirectory of your main directory. 15 | ; (compile 'clojure.testgenclass3) 16 | ; 17 | ; Tests: 18 | ; 19 | ; (def v (my.TGC3/fy)) 20 | ; (.add v 12) 21 | ; (.add v 13) 22 | ; (.val v) 23 | ; (.zero v) 24 | ; (.val v) 25 | 26 | 27 | (ns clojure.testgenclass3 28 | (:gen-class 29 | :state state 30 | :init init 31 | :main false 32 | :name my.TGC3 33 | :factory fy 34 | :methods [ 35 | [zero [] Int32] 36 | [add [Int32] Int32] 37 | [val [] Int32] ])) 38 | 39 | 40 | (defn -init [] 41 | [[] (ref 0)]) 42 | 43 | (defn -zero [this] 44 | (dosync 45 | (let [state (.state this) 46 | old @state] 47 | (ref-set state 0) 48 | old))) 49 | 50 | (defn -add [this val] 51 | (print (str this)) 52 | (print (str val)) 53 | (dosync 54 | (commute (.state this) + val))) 55 | 56 | (defn -val [this] 57 | @(.state this)) 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/genclass/testmvc.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: David Miller 10 | 11 | ; Test of gen-class facility. 12 | ; 13 | ; Place this file in the clojure subdirectory of your main directory. 14 | ; (compile 'clojure.testmvc) 15 | ; 16 | ; You should then be able to play games such as: 17 | 18 | ; (def v (clojure.testmvc/fy) 19 | ; (.index v) 20 | 21 | 22 | (System.Reflection.Assembly/Load "System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL") 23 | 24 | (ns clojure.testmvc 25 | (:gen-class 26 | :factory fy 27 | :extends System.Web.Mvc.Controller 28 | :methods [ 29 | [index [] System.Web.Mvc.ActionResult] 30 | ])) 31 | 32 | (defn -index [] 33 | (.Content "Hello World, from Clojure Controller")) 34 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/interop/C.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richhickey/clojure-clr/2c7e20cd3c6ffc64b783ddb3cb7984fb93472ad4/Clojure/Clojure.Source/clojure/samples/interop/C.dll -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/proxy/testproxy.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: David Miller 10 | 11 | ; Test of proxy code 12 | ; 13 | ; Place this file in the clojure subdirectory of your main directory. 14 | ; Start Clojure and do: 15 | ; (compile 'clojure.testproxy ') 16 | ; 17 | ; You should then be able to play games such as: 18 | ; 19 | 20 | 21 | 22 | (ns clojure.testproxy) 23 | 24 | (defn cp1 [] 25 | (proxy [Object] [])) 26 | 27 | (defn cp2 [] 28 | (proxy [Object] [] 29 | (ToString [] "abc"))) 30 | 31 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/samples/stm/teststm.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: Shawn Hoover 10 | 11 | ; Simple test of the STM. 12 | ; (f1) 13 | 14 | 15 | (ns clojure.teststm) 16 | 17 | 18 | (defn sleep [time-ms] (System.Threading.Thread/Sleep time-ms)) 19 | 20 | (def a (ref #{})) 21 | (def b (ref #{})) 22 | 23 | (def cycle-continue true) 24 | 25 | (defn make-future [id] 26 | (future 27 | (try 28 | (loop [n 0] 29 | ;; join the party 30 | (dosync 31 | (alter a conj id) 32 | (alter b conj id)) 33 | 34 | ;; validate the refs 35 | (dosync 36 | (let [current-a @a 37 | current-b @b] 38 | (if (not (= current-a current-b)) 39 | (throw (Exception. (str (format "\n%s\n%s" current-a current-b))))))) 40 | 41 | ;; leave 42 | (dosync 43 | (alter a disj id) 44 | (alter b disj id)) 45 | 46 | (if cycle-continue 47 | (recur (inc n)))) 48 | (catch Exception ex 49 | (def cycle-continue false) 50 | (sleep 100) 51 | (println ex))))) 52 | 53 | ; (f1 3 30) 54 | ; should see 30 dots, then done, unless an error occurs. Then you will see an error message printed. 55 | 56 | (defn f1 [nagts dur] 57 | (future 58 | (do 59 | (def a (ref #{})) 60 | (def b (ref #{})) 61 | (def cycle-continue true) 62 | (let [n-agents nagts 63 | duration dur 64 | futures (doall (map make-future (range n-agents)))] 65 | (loop [i 0] 66 | (sleep 1000) 67 | (print ".") (flush) 68 | (if (and (<= i duration) cycle-continue) 69 | (recur (inc i))))) 70 | (println "done") 71 | (def cycle-continue false)))) 72 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/template.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ;;; template.clj - anonymous functions that pre-evaluate sub-expressions 10 | 11 | ;; By Stuart Sierra 12 | ;; June 23, 2009 13 | 14 | ;; CHANGE LOG 15 | ;; 16 | ;; June 23, 2009: complete rewrite, eliminated _1,_2,... argument 17 | ;; syntax 18 | ;; 19 | ;; January 20, 2009: added "template?" and checks for valid template 20 | ;; expressions. 21 | ;; 22 | ;; December 15, 2008: first version 23 | 24 | 25 | (ns ^{:doc "Macros that expand to repeated copies of a template expression." 26 | :author "Stuart Sierra"} 27 | clojure.template 28 | (:require [clojure.walk :as walk])) 29 | 30 | (defn apply-template 31 | "For use in macros. argv is an argument list, as in defn. expr is 32 | a quoted expression using the symbols in argv. values is a sequence 33 | of values to be used for the arguments. 34 | 35 | apply-template will recursively replace argument symbols in expr 36 | with their corresponding values, returning a modified expr. 37 | 38 | Example: (apply-template '[x] '(+ x x) '[2]) 39 | ;=> (+ 2 2)" 40 | [argv expr values] 41 | (assert (vector? argv)) 42 | (assert (every? symbol? argv)) 43 | (walk/prewalk-replace (zipmap argv values) expr)) 44 | 45 | (defmacro do-template 46 | "Repeatedly copies expr (in a do block) for each group of arguments 47 | in values. values are automatically partitioned by the number of 48 | arguments in argv, an argument vector as in defn. 49 | 50 | Example: (macroexpand '(do-template [x y] (+ y x) 2 4 3 5)) 51 | ;=> (do (+ 4 2) (+ 5 3))" 52 | [argv expr & values] 53 | (let [c (count argv)] 54 | `(do ~@(map (fn [a] (apply-template argv expr a)) 55 | (partition c values))))) 56 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/atoms.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ;;Author: Frantisek Sodomka 10 | 11 | (ns clojure.test-clojure.atoms 12 | (:use clojure.test)) 13 | 14 | ; http://clojure.org/atoms 15 | 16 | ; atom 17 | ; deref, @-reader-macro 18 | ; swap! reset! 19 | ; compare-and-set! 20 | 21 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/clojure_walk.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.test-clojure.clojure-walk 2 | (:require [clojure.walk :as w]) 3 | (:use clojure.test)) 4 | 5 | (deftest t-prewalk-replace 6 | (is (= (w/prewalk-replace {:a :b} [:a {:a :a} (list 3 :c :a)]) 7 | [:b {:b :b} (list 3 :c :b)]))) 8 | 9 | (deftest t-postwalk-replace 10 | (is (= (w/postwalk-replace {:a :b} [:a {:a :a} (list 3 :c :a)]) 11 | [:b {:b :b} (list 3 :c :b)]))) 12 | 13 | (deftest t-stringify-keys 14 | (is (= (w/stringify-keys {:a 1, nil {:b 2 :c 3}, :d 4}) 15 | {"a" 1, nil {"b" 2 "c" 3}, "d" 4}))) 16 | 17 | (deftest t-prewalk-order 18 | (is (= (let [a (atom [])] 19 | (w/prewalk (fn [form] (swap! a conj form) form) 20 | [1 2 {:a 3} (list 4 [5])]) 21 | @a) 22 | [[1 2 {:a 3} (list 4 [5])] 23 | 1 2 {:a 3} [:a 3] :a 3 (list 4 [5]) 24 | 4 [5] 5]))) 25 | 26 | (deftest t-postwalk-order 27 | (is (= (let [a (atom [])] 28 | (w/postwalk (fn [form] (swap! a conj form) form) 29 | [1 2 {:a 3} (list 4 [5])]) 30 | @a) 31 | [1 2 32 | :a 3 [:a 3] {:a 3} 33 | 4 5 [5] (list 4 [5]) 34 | [1 2 {:a 3} (list 4 [5])]]))) 35 | 36 | (deftest walk 37 | "Checks that walk returns the correct result and type of collection" 38 | (let [colls ['(1 2 3) 39 | [1 2 3] 40 | #{1 2 3} 41 | (sorted-set-by > 1 2 3) 42 | {:a 1, :b 2, :c 3} 43 | (sorted-map-by > 1 10, 2 20, 3 30)]] 44 | (doseq [c colls] 45 | (let [walked (w/walk identity identity c)] 46 | (is (= c walked)) 47 | (is (= (type c) (type walked))) 48 | (if (map? c) 49 | (is (= (w/walk #(update-in % [1] inc) #(reduce + (vals %)) c) 50 | (reduce + (map (comp inc val) c)))) 51 | (is (= (w/walk inc #(reduce + %) c) 52 | (reduce + (map inc c))))) 53 | (when (or (instance? clojure.lang.PersistentTreeMap c) 54 | (instance? clojure.lang.PersistentTreeSet c)) 55 | (is (= (.comparator c) (.comparator walked)))))))) 56 | 57 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/clojure_xml.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ;;Author: Frantisek Sodomka 10 | 11 | 12 | (ns clojure.test-clojure.clojure-xml 13 | (:use clojure.test) 14 | (:require [clojure.xml :as xml])) 15 | 16 | 17 | ; parse 18 | 19 | ; emit-element 20 | ; emit 21 | 22 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/clojure_zip.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ; Author: Frantisek Sodomka 10 | 11 | 12 | (ns clojure.test-clojure.clojure-zip 13 | (:use clojure.test) 14 | (:require [clojure.zip :as zip])) 15 | 16 | 17 | ; zipper 18 | ; 19 | ; seq-zip 20 | ; vector-zip 21 | ; xml-zip 22 | ; 23 | ; node 24 | ; branch? 25 | ; children 26 | ; make-node 27 | ; path 28 | ; lefts 29 | ; rights 30 | ; down 31 | ; up 32 | ; root 33 | ; right 34 | ; rightmost 35 | ; left 36 | ; leftmost 37 | ; 38 | ; insert-left 39 | ; insert-right 40 | ; replace 41 | ; edit 42 | ; insert-child 43 | ; append-child 44 | ; next 45 | ; prev 46 | ; end? 47 | ; remove 48 | 49 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/data.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | (ns clojure.test-clojure.data 10 | (:use clojure.data clojure.test) 11 | ) ;;;(:import java.util.HashSet) 12 | 13 | (deftest diff-test 14 | (are [d x y] (= d (diff x y)) 15 | [nil nil nil] nil nil 16 | [1 2 nil] 1 2 17 | [nil nil [1 2 3]] [1 2 3] '(1 2 3) 18 | [1 [:a :b] nil] 1 [:a :b] 19 | [{:a 1} :b nil] {:a 1} :b 20 | [:team #{:p1 :p2} nil] :team #{:p1 :p2} 21 | [{0 :a} [:a] nil] {0 :a} [:a] 22 | [nil [nil 2] [1]] [1] [1 2] 23 | [nil nil [1 2]] [1 2] (into-array [1 2]) 24 | [#{:a} #{:b} #{:c :d}] #{:a :c :d} #{:b :c :d} 25 | [nil nil {:a 1}] {:a 1} {:a 1} 26 | [{:a #{2}} {:a #{4}} {:a #{3}}] {:a #{2 3}} {:a #{3 4}} 27 | ;;;[#{1} #{3} #{2}] (|System.Collections.Generic.List`1[System.Object]|. [1 2]) (|System.Collections.Generic.List`1[System.Object]|. [2 3]) ;;; HashSet 28 | [nil nil [1 2]] [1 2] (into-array [1 2]) 29 | [nil nil [1 2]] (into-array [1 2]) [1 2] 30 | [{:a {:c [1]}} {:a {:c [0]}} {:a {:c [nil 2] :b 1}}] {:a {:b 1 :c [1 2]}} {:a {:b 1 :c [0 2]}})) 31 | 32 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/def.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | (ns clojure.test-clojure.def 10 | (:use clojure.test clojure.test-helper 11 | clojure.test-clojure.protocols)) 12 | 13 | (deftest defn-error-messages 14 | (testing "bad arglist forms" 15 | (is (fails-with-cause? ArgumentException '#"Parameter declaration arg1 should be a vector" ;;; IllegalArgumentException 16 | (eval-in-temp-ns (defn foo (arg1 arg2))))))) 17 | 18 | (deftest dynamic-redefinition 19 | ;; too many contextual things for this kind of caching to work... 20 | (testing "classes are never cached, even if their bodies are the same" 21 | (is (= :b 22 | (eval 23 | '(do 24 | (defmacro my-macro [] :a) 25 | (defn do-macro [] (my-macro)) 26 | (defmacro my-macro [] :b) 27 | (defn do-macro [] (my-macro)) 28 | (do-macro))))))) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/errors.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ;; Tests for error handling and messages 10 | 11 | (ns clojure.test-clojure.errors 12 | (:use clojure.test) 13 | (:import clojure.lang.ArityException)) 14 | 15 | (defn f0 [] 0) 16 | 17 | (defn f1 [a] a) 18 | 19 | (defmacro m0 [] `(identity 0)) 20 | 21 | (defmacro m1 [a] `(inc ~a)) 22 | 23 | (deftest arity-exception 24 | ;; IllegalArgumentException is pre-1.3 25 | (is (thrown-with-msg? ArgumentException #"Wrong number of args \(1\) passed to" ;;; IllegalArgumentException 26 | (f0 1))) 27 | (is (thrown-with-msg? ArityException #"Wrong number of args \(0\) passed to" 28 | (f1))) 29 | (is (thrown-with-msg? ArityException #"Wrong number of args \(1\) passed to" 30 | (macroexpand `(m0 1)))) 31 | (is (thrown-with-msg? ArityException #"Wrong number of args \(2\) passed to" 32 | (macroexpand `(m1 1 2))))) 33 | 34 | (deftest assert-arg-messages 35 | ; used to ensure that error messages properly use local names for macros 36 | (refer 'clojure.core :rename '{with-open renamed-with-open}) 37 | 38 | ; would have used `are` here, but :line meta on &form doesn't survive successive macroexpansions 39 | (doseq [[msg-regex-str form] [["if-let .* in %s:\\d+" '(if-let [a 5 40 | b 6] 41 | true nil)] 42 | ["let .* in %s:\\d+" '(let [a])] 43 | ["let .* in %s:\\d+" '(let (a))] 44 | ["renamed-with-open .* in %s:\\d+" '(renamed-with-open [a])]]] 45 | (is (thrown-with-msg? ArgumentException ;;; IllegalArgumentException 46 | (re-pattern (format msg-regex-str *ns*)) 47 | (macroexpand form))))) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/keywords.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | (ns clojure.test-clojure.keywords 10 | (:use clojure.test)) 11 | 12 | (let [this-ns (str (.Name *ns*))] ;;; .name 13 | (deftest test-find-keyword 14 | :foo 15 | ::foo 16 | (let [absent-keyword-sym (gensym "absent-keyword-sym")] 17 | (are [result lookup] (= result (find-keyword lookup)) 18 | :foo :foo 19 | :foo 'foo 20 | :foo "foo" 21 | nil absent-keyword-sym 22 | nil (str absent-keyword-sym)) 23 | (are [result lookup] (= result (find-keyword this-ns lookup)) 24 | ::foo "foo" 25 | nil (str absent-keyword-sym))))) 26 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/load.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | (ns clojure.test-clojure.load 10 | (:use clojure.test)) 11 | 12 | (deftest test-load 13 | (testing "Should ignore self-loads without comment" 14 | (is (nil? (require 'clojure.test-clojure.load.cyclic0)))) 15 | (testing "Should reject cyclic dependencies" 16 | (testing "a->b->a" 17 | (is (thrown-with-msg? Exception #".*Cyclic load dependency.*" 18 | (require 'clojure.test-clojure.load.cyclic1)))) 19 | (testing "a->b->c->d->b" 20 | (is (thrown-with-msg? Exception #".*Cyclic load dependency.*" 21 | (require 'clojure.test-clojure.load.cyclic3)))))) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/load/cyclic0.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: Stephen C. Gilardi 10 | 11 | (ns clojure.test-clojure.load.cyclic0 12 | (:require clojure.test-clojure.load.cyclic0)) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/load/cyclic1.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: Stephen C. Gilardi 10 | 11 | (ns clojure.test-clojure.load.cyclic1 12 | (:require clojure.test-clojure.load.cyclic2)) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/load/cyclic2.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: Stephen C. Gilardi 10 | 11 | (ns clojure.test-clojure.load.cyclic2 12 | (:require clojure.test-clojure.load.cyclic1)) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/load/cyclic3.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: Stephen C. Gilardi 10 | 11 | (ns clojure.test-clojure.load.cyclic3 12 | (:require clojure.test-clojure.load.cyclic4)) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/load/cyclic4.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: Stephen C. Gilardi 10 | 11 | (ns clojure.test-clojure.load.cyclic4 12 | (:require clojure.test-clojure.load.cyclic5)) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/load/cyclic5.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: Stephen C. Gilardi 10 | 11 | (ns clojure.test-clojure.load.cyclic5 12 | (:require clojure.test-clojure.load.cyclic6)) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/load/cyclic6.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ; Author: Stephen C. Gilardi 10 | 11 | (ns clojure.test-clojure.load.cyclic6 12 | (:require clojure.test-clojure.load.cyclic4)) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/macros.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ; Author: Frantisek Sodomka 10 | 11 | (ns clojure.test-clojure.macros 12 | (:use clojure.test)) 13 | 14 | ; http://clojure.org/macros 15 | 16 | ; -> 17 | ; defmacro definline macroexpand-1 macroexpand 18 | 19 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/main.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ; Author: Stuart Halloway 10 | 11 | 12 | (ns clojure.test-clojure.main 13 | (:use clojure.test 14 | [clojure.test-helper :only [platform-newlines]]) 15 | (:require [clojure.main :as main])) 16 | 17 | (deftest eval-opt 18 | (testing "evals and prints forms" 19 | (is (= (platform-newlines "2\n4\n") (with-out-str (#'clojure.main/eval-opt "(+ 1 1) (+ 2 2)"))))) 20 | 21 | (testing "skips printing nils" 22 | (is (= (platform-newlines ":a\n:c\n") (with-out-str (#'clojure.main/eval-opt ":a nil :c"))))) 23 | 24 | (testing "does not block access to *in* (#299)" 25 | (with-in-str "(+ 1 1)" 26 | (is (= (platform-newlines "(+ 1 1)\n") (with-out-str (#'clojure.main/eval-opt "(read)"))))))) 27 | 28 | (defmacro with-err-str 29 | "Evaluates exprs in a context in which *err* is bound to a fresh 30 | StringWriter. Returns the string created by any nested printing 31 | calls." 32 | [& body] 33 | `(let [s# (new System.IO.StringWriter) ;;; (new java.io.StringWriter) 34 | p# s#] ;;; (new java.io.PrintWriter s#)] 35 | (binding [*err* p#] 36 | ~@body 37 | (str s#)))) 38 | 39 | (defn run-repl-and-return-err 40 | "Run repl, swallowing stdout and returing stderr." 41 | [in-str] 42 | (with-err-str 43 | (with-out-str 44 | (with-in-str in-str 45 | (main/repl))))) 46 | 47 | ;argh - test fragility, please fix 48 | #_(deftest repl-exception-safety 49 | (testing "catches and prints exception on bad equals" 50 | (is (re-find #"^System.MissingMethodException" ;;; (is (= "java.lang.NullPointerException\n" 51 | (run-repl-and-return-err 52 | "(proxy [Object] [] (Equals [o] (.ToString nil)))"))))) ;;; equals .toString 53 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/parallel.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ; Author: Frantisek Sodomka 10 | 11 | 12 | (ns clojure.test-clojure.parallel 13 | (:use clojure.test)) 14 | 15 | ;; !! Tests for the parallel library will be in a separate file clojure_parallel.clj !! 16 | 17 | ; future-call 18 | ; future 19 | ; pmap 20 | ; pcalls 21 | ; pvalues 22 | 23 | ;;; no pmap yet. 24 | ;; pmap 25 | ;; 26 | ;;;(deftest pmap-does-its-thing 27 | ;;; ;; regression fixed in r1218; was OutOfMemoryError 28 | ;;; (is (= '(1) (pmap inc [0])))) 29 | 30 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/pprint.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ;; Author: Tom Faulhaber 10 | 11 | (ns clojure.test-clojure.pprint 12 | (:refer-clojure :exclude [format]) 13 | (:use [clojure.test :only (deftest are run-tests)] 14 | [clojure.test-helper :only [platform-newlines]] 15 | clojure.test-clojure.pprint.test-helper 16 | clojure.pprint)) 17 | 18 | (load "pprint/test_cl_format") 19 | (load "pprint/test_pretty") 20 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/pprint/test_helper.clj: -------------------------------------------------------------------------------- 1 | ;;; test_helper.clj -- part of the pretty printer for Clojure 2 | 3 | ; Copyright (c) Rich Hickey. All rights reserved. 4 | ; The use and distribution terms for this software are covered by the 5 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 6 | ; which can be found in the file epl-v10.html at the root of this distribution. 7 | ; By using this software in any fashion, you are agreeing to be bound by 8 | ; the terms of this license. 9 | ; You must not remove this notice, or any other, from this software. 10 | 11 | ;; Author: Tom Faulhaber 12 | ;; April 3, 2009 13 | 14 | 15 | ;; This is just a macro to make my tests a little cleaner 16 | 17 | (ns clojure.test-clojure.pprint.test-helper 18 | (:use [clojure.test :only (deftest is)] 19 | [clojure.test-helper :only [platform-newlines]])) 20 | 21 | (defn- back-match [x y] (re-matches y x)) 22 | 23 | (defmacro simple-tests [name & test-pairs] 24 | `(deftest ~name 25 | ~@(for [[x y] (partition 2 test-pairs)] 26 | (cond 27 | (instance? System.Text.RegularExpressions.Regex y) ;;; java.util.regex.Pattern 28 | `(is (#'clojure.test-clojure.pprint.test-helper/back-match ~x ~y)) 29 | (instance? String y) `(is (= ~x (platform-newlines ~y))) 30 | :else `(is (= ~x ~y)))))) 31 | 32 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/protocols/examples.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.test-clojure.protocols.examples) 2 | 3 | (defprotocol ExampleProtocol 4 | "example protocol used by clojure tests" 5 | 6 | (foo [a] "method with one arg") 7 | (bar [a b] "method with two args") 8 | (^String baz [a] [a b] "method with multiple arities") 9 | (with-quux [a] "method name with a hyphen")) 10 | 11 | (definterface ExampleInterface 12 | (hinted [^int i]) 13 | (hinted [^String s])) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/protocols/more_examples.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.test-clojure.protocols.more-examples) 2 | 3 | (defprotocol SimpleProtocol 4 | "example protocol used by clojure tests. Note that 5 | foo collides with examples/ExampleProtocol." 6 | 7 | (foo [a] "")) 8 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/refs.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ; Author: Frantisek Sodomka 10 | 11 | 12 | (ns clojure.test-clojure.refs 13 | (:use clojure.test)) 14 | 15 | ; http://clojure.org/refs 16 | 17 | ; ref 18 | ; deref, @-reader-macro 19 | ; dosync io! 20 | ; ensure ref-set alter commute 21 | ; set-validator get-validator 22 | 23 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/repl.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.test-clojure.repl 2 | (:use clojure.test 3 | clojure.repl 4 | [clojure.test-helper :only [platform-newlines]] 5 | clojure.test-clojure.repl.example)) 6 | 7 | (deftest test-source 8 | (is (= "(defn foo [])" (source-fn 'clojure.test-clojure.repl.example/foo))) 9 | (is (= (platform-newlines "(defn foo [])\n") (with-out-str (source clojure.test-clojure.repl.example/foo)))) 10 | (is (nil? (source-fn 'non-existent-fn)))) 11 | 12 | (deftest test-dir 13 | (is (thrown? Exception (dir-fn 'non-existent-ns))) 14 | (is (= '[bar foo] (dir-fn 'clojure.test-clojure.repl.example))) 15 | (is (= (platform-newlines "bar\nfoo\n") (with-out-str (dir clojure.test-clojure.repl.example))))) 16 | 17 | (deftest test-apropos 18 | (testing "with a regular expression" 19 | (is (= '[defmacro] (apropos #"^defmacro$"))) 20 | (is (some #{'defmacro} (apropos #"def.acr."))) 21 | (is (= [] (apropos #"nothing-has-this-name")))) 22 | 23 | (testing "with a string" 24 | (is (some #{'defmacro} (apropos "defmacro"))) 25 | (is (some #{'defmacro} (apropos "efmac"))) 26 | (is (= [] (apropos "nothing-has-this-name")))) 27 | 28 | (testing "with a symbol" 29 | (is (some #{'defmacro} (apropos 'defmacro))) 30 | (is (some #{'defmacro} (apropos 'efmac))) 31 | (is (= [] (apropos 'nothing-has-this-name))))) 32 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/repl/example.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.test-clojure.repl.example) 2 | 3 | ;; sample namespace for repl tests, don't add anything here 4 | (defn foo []) 5 | (defn bar []) 6 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/special.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | ; Author: Frantisek Sodomka 10 | 11 | ;; 12 | ;; Test special forms, macros and metadata 13 | ;; 14 | 15 | (ns clojure.test-clojure.special 16 | (:use clojure.test)) 17 | 18 | ; http://clojure.org/special_forms 19 | 20 | ; let, letfn 21 | ; quote 22 | ; var 23 | ; fn 24 | 25 | -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/test_fixtures.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | ; 9 | ;;; test_fixtures.clj: unit tests for fixtures in test.clj 10 | 11 | ;; by Stuart Sierra 12 | ;; March 28, 2009 13 | 14 | (ns clojure.test-clojure.test-fixtures 15 | (:use clojure.test)) 16 | 17 | (declare ^:dynamic *a* ^:dynamic *b* ^:dynamic *c* ^:dynamic *d*) 18 | 19 | (def ^:dynamic *n* 0) 20 | 21 | (defn fixture-a [f] 22 | (binding [*a* 3] (f))) 23 | 24 | (defn fixture-b [f] 25 | (binding [*b* 5] (f))) 26 | 27 | (defn fixture-c [f] 28 | (binding [*c* 7] (f))) 29 | 30 | (defn fixture-d [f] 31 | (binding [*d* 11] (f))) 32 | 33 | (defn inc-n-fixture [f] 34 | (binding [*n* (inc *n*)] (f))) 35 | 36 | (use-fixtures :once fixture-a fixture-b) 37 | 38 | (use-fixtures :each fixture-c fixture-d inc-n-fixture) 39 | (use-fixtures :each fixture-c fixture-d inc-n-fixture) 40 | 41 | (deftest can-use-once-fixtures 42 | (is (= 3 *a*)) 43 | (is (= 5 *b*))) 44 | 45 | (deftest can-use-each-fixtures 46 | (is (= 7 *c*)) 47 | (is (= 11 *d*))) 48 | 49 | (deftest use-fixtures-replaces 50 | (is (= *n* 1))) -------------------------------------------------------------------------------- /Clojure/Clojure.Source/clojure/test_clojure/transients.clj: -------------------------------------------------------------------------------- 1 | (ns clojure.test-clojure.transients 2 | (:use clojure.test)) 3 | 4 | (deftest popping-off 5 | (testing "across a node boundary" 6 | (are [n] 7 | (let [v (-> (range n) vec)] 8 | (= (subvec v 0 (- n 2)) (-> v transient pop! pop! persistent!))) 9 | 33 (+ 32 (inc (* 32 32))) (+ 32 (inc (* 32 32 32))))) 10 | (testing "off the end" 11 | (is (thrown-with-msg? InvalidOperationException #"Can't pop empty vector" ;;; IllegalStateException 12 | (-> [] transient pop!)))) 13 | (testing "copying array from a non-editable when put in tail position") 14 | (is (= 31 (let [pv (vec (range 34))] 15 | (-> pv transient pop! pop! pop! (conj! 42)) 16 | (nth pv 31))))) 17 | 18 | (defn- hash-obj [hash] 19 | (reify Object (GetHashCode [this] hash))) ;;; hashCode 20 | 21 | (deftest dissocing 22 | (testing "dissocing colliding keys" 23 | (is (= [0 {}] (let [ks (concat (range 7) [(hash-obj 42) (hash-obj 42)]) 24 | m (zipmap ks ks) 25 | dm (persistent! (reduce dissoc! (transient m) (keys m)))] 26 | [(count dm) dm]))))) -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/FixtureSetupClass.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | using NUnit.Framework; 21 | using clojure.lang; 22 | 23 | 24 | [SetUpFixture] 25 | public class FixtureSetupClass 26 | { 27 | [SetUp] 28 | public void Setup() 29 | { 30 | RuntimeBootstrapFlag._doRTBootstrap = false; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/AFnImplTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add AFnImpl tests 23 | class AFnImplTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/ARefTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add tests for Aref 23 | class ARefTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/AgentTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add tests for Agent 23 | class AgentTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/ArrayStreamTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add ArrayStream tests 23 | class ArrayStreamTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/AtomTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add tests for Atom 23 | class AtomTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/CachedSeqTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: write tests for CachedSeq 23 | class CachedSeqTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/DelayTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | class DelayTests 23 | { 24 | //TODO: Write Delay tests 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/DummyFn.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using clojure.lang; 6 | 7 | namespace Clojure.Tests.LibTests 8 | { 9 | /// 10 | /// Dummy IFn to use in reduce tests 11 | /// 12 | public static class DummyFn 13 | { 14 | public static IFn CreateForReduce() 15 | { 16 | AFnImpl fn = new AFnImpl(); 17 | fn._fn2 = ( object x, object y ) => { return ((int)x) + ((int)y); }; 18 | return fn; 19 | } 20 | 21 | internal static IFn CreateForMetaAlter(IPersistentMap meta) 22 | { 23 | AFnImpl fn = new AFnImpl(); 24 | fn._fn0 = () => { return meta; }; 25 | fn._fn1 = (object x) => { return meta; }; 26 | return fn; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/EnumeratorSeqTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests 21 | { 22 | // TODO: Add tests for EnumeratorSeq 23 | class EnumeratorSeqTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/ISeqTestHelper.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using NUnit.Framework; 20 | using clojure.lang; 21 | 22 | namespace Clojure.Tests.LibTests 23 | { 24 | public class ISeqTestHelper : AssertionHelper 25 | { 26 | public void VerifyISeqContents(ISeq s, IList values) 27 | { 28 | int i=0; 29 | 30 | for (; s != null; s = s.next(), i++) 31 | Expect(s.first(), EqualTo(values[i])); 32 | 33 | Expect(i, EqualTo(values.Count)); 34 | } 35 | 36 | public void VerifyISeqCons(ISeq s, object newVal, IList values) 37 | { 38 | ISeq newSeq = s.cons(newVal); 39 | 40 | Expect(newSeq.first(), EqualTo(newVal)); 41 | VerifyISeqContents(newSeq.next(), values); 42 | } 43 | 44 | public void VerifyISeqRestTypes(ISeq s, Type type) 45 | { 46 | for ( ; s.next() != null; s = s.next()) 47 | Expect(s.next(), InstanceOf(type)); 48 | } 49 | 50 | public void VerifyISeqRestMaintainsMeta(ISeq s) 51 | { 52 | IPersistentMap meta = ((IMeta)s).meta(); 53 | 54 | for (; s.next() != null; s = s.next()) 55 | Expect(((IMeta)s.next()).meta(), EqualTo(meta)); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/IteratorStreamTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | //TODO: add tests for IteratorStream 23 | class IteratorStreamTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/LazySeqTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add LazySeq tests 23 | class LazySeqTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/ObjTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | using NUnit.Framework; 21 | 22 | using clojure.lang; 23 | 24 | 25 | namespace Clojure.Tests.LibTests 26 | { 27 | [TestFixture] 28 | public class ObjTests : IObjTests 29 | { 30 | 31 | class MockObj : Obj 32 | { 33 | public MockObj() 34 | { 35 | } 36 | 37 | public MockObj(IPersistentMap meta) 38 | : base(meta) 39 | { 40 | } 41 | 42 | public override IObj withMeta(IPersistentMap meta) 43 | { 44 | return meta == _meta 45 | ? this 46 | : new MockObj(meta); 47 | } 48 | } 49 | 50 | 51 | [SetUp] 52 | public void Setup() 53 | { 54 | IPersistentMap meta = new DummyMeta(); 55 | 56 | _objWithNullMeta = new MockObj(); 57 | _obj = new MockObj(meta); 58 | _expectedType = typeof(MockObj); 59 | } 60 | 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/PersistentQueueTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add tests for PersistentQueue 23 | class PersistentQueueTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/PersistentStructMapTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add tests for PersistentStructMap 23 | class PersistentStructMapTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/PersistentTreeSetTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | using NUnit.Framework; 21 | 22 | using clojure.lang; 23 | 24 | 25 | namespace Clojure.Tests.LibTests 26 | { 27 | // TODO: Add tests for PersistentTreeSet 28 | class PersistentTreeSetTests 29 | { 30 | } 31 | 32 | [TestFixture] 33 | public class PersistentTreeSet_IObj_Tests : IObjTests 34 | { 35 | 36 | [SetUp] 37 | public void Setup() 38 | { 39 | IPersistentMap meta = new DummyMeta(); 40 | 41 | PersistentTreeSet m = PersistentTreeSet.create(RT.seq(PersistentVector.create("a", "b"))); 42 | 43 | _objWithNullMeta = (IObj)m; 44 | _obj = _objWithNullMeta.withMeta(meta); 45 | _expectedType = typeof(PersistentTreeSet); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/RefTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add tests for Ref 23 | 24 | class RefTests 25 | { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/RestFnImplTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | //TODO: Add RestFnImpl tests 23 | class RestFnImplTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/RestFnTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: Add RestFn tests 23 | class RestFnTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/StreamTests.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Clojure.Tests.LibTests 21 | { 22 | // TODO: add tests for Stream 23 | class StreamTests 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/LibTests/TestTest.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | 21 | 22 | using NUnit.Framework; 23 | 24 | 25 | namespace Clojure.Tests.LibTests 26 | { 27 | 28 | 29 | //public class BaseTest : AssertionHelper 30 | //{ 31 | // [Test] 32 | // public void Test1() 33 | // { 34 | // Console.WriteLine("T1"); 35 | // } 36 | 37 | // [Test] 38 | // public void Test2() 39 | // { 40 | // Console.WriteLine("T2"); 41 | // } 42 | 43 | //} 44 | 45 | //[TestFixture] 46 | //public class TestTest : BaseTest 47 | //{ 48 | // [Test] 49 | // public void Test3() 50 | // { 51 | // Console.WriteLine("T3"); 52 | // } 53 | //} 54 | 55 | 56 | 57 | //[TestFixture] 58 | //public class TestTest2 : BaseTest 59 | //{ 60 | // [Test] 61 | // public void Test4() 62 | // { 63 | // Console.WriteLine("T4"); 64 | // } 65 | //} 66 | } 67 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Clojure.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Clojure.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6741a194-da64-4dd1-8fcf-6ed1248acd29")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Clojure/Clojure.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Clojure/Clojure/Bootstrap/test.clj: -------------------------------------------------------------------------------- 1 | ; Copyright (c) David Miller. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | 10 | (ns clojure.test) 11 | 12 | ; check generation of boolean test when test is known to be of type bool. 13 | 14 | (defn test-if [i n] ( if (> i n) 'a 'b)) 15 | 16 | ; check generation of boolean test when test type is not known. 17 | 18 | (defn test-if2-test [i n] (> i n)) 19 | (defn test-if2 [i n] (if (test-if2-test i n) 'a 'b)) 20 | 21 | ; check generation of boolean test when return type is not bool. 22 | (defn test-if3 [i n] (if i n 'b)) 23 | 24 | 25 | ; basic check of type tagging from the Clojure docs: 26 | (defn len [x] (. x Length)) 27 | (defn len2 [#^String x] (. x Length)) 28 | 29 | (defn test-len [] (time (reduce + (map len (replicate 10000 "asdf"))))) 30 | (defn test-len2 [] (time (reduce + (map len2 (replicate 10000 "asdf"))))) 31 | 32 | ; my first test ever. It still runs slow 33 | (defn f1 [l n] (if (> (count l) n) nil (recur (cons 'a l) n))) 34 | (defn test-f1 [] (time (f1 nil 10000))) 35 | 36 | (defn f-dotimes [n] (dotimes [i n] (list i))) 37 | (defn test-dotimes [] (time (f-dotimes 100000))) 38 | 39 | 40 | -------------------------------------------------------------------------------- /Clojure/Clojure/Bootstrap/version.properties: -------------------------------------------------------------------------------- 1 | version=1.4.0-master-SNAPSHOT -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/AssignableExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | #if CLR2 17 | using Microsoft.Scripting.Ast; 18 | #else 19 | using System.Linq.Expressions; 20 | #endif 21 | 22 | 23 | namespace clojure.lang.CljCompiler.Ast 24 | { 25 | interface AssignableExpr 26 | { 27 | object EvalAssign(Expr val); 28 | Expression GenAssign(RHC rhc, ObjExpr objx, GenContext context, Expr val); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/BindingInit.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang.CljCompiler.Ast 17 | { 18 | struct BindingInit 19 | { 20 | #region Data 21 | 22 | private readonly LocalBinding _binding; 23 | public LocalBinding Binding 24 | { 25 | get { return _binding; } 26 | } 27 | 28 | private readonly Expr _init; 29 | public Expr Init 30 | { 31 | get { return _init; } 32 | } 33 | 34 | public BindingInit(LocalBinding binding, Expr init) 35 | { 36 | _binding = binding; 37 | _init = init; 38 | } 39 | 40 | #endregion 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/BooleanExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | 24 | namespace clojure.lang.CljCompiler.Ast 25 | { 26 | class BooleanExpr : LiteralExpr 27 | { 28 | #region Data 29 | 30 | readonly bool _val; 31 | 32 | public override object Val 33 | { 34 | get { return _val; } 35 | } 36 | 37 | #endregion 38 | 39 | #region C-tors 40 | 41 | public BooleanExpr(bool val) 42 | { 43 | _val = val; 44 | } 45 | 46 | #endregion 47 | 48 | #region Type mangling 49 | 50 | public override bool HasClrType 51 | { 52 | get { return true; } 53 | } 54 | 55 | public override Type ClrType 56 | { 57 | get { return typeof(Boolean); } 58 | } 59 | 60 | #endregion 61 | 62 | #region Code generation 63 | 64 | public override Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 65 | { 66 | return Expression.Constant(_val); 67 | } 68 | 69 | #endregion 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/Expr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | namespace clojure.lang.CljCompiler.Ast 24 | { 25 | 26 | public interface Expr 27 | { 28 | bool HasClrType { get; } 29 | Type ClrType { get; } 30 | 31 | object Eval(); 32 | Expression GenCode(RHC rhc, ObjExpr objx, GenContext context); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/FieldExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | #if CLR2 17 | using Microsoft.Scripting.Ast; 18 | #else 19 | using System.Linq.Expressions; 20 | #endif 21 | 22 | 23 | namespace clojure.lang.CljCompiler.Ast 24 | { 25 | abstract class FieldOrPropertyExpr : HostExpr, AssignableExpr 26 | { 27 | #region AssignableExpr Members 28 | 29 | public abstract object EvalAssign(Expr val); 30 | public abstract Expression GenAssign(RHC rhc, ObjExpr objx, GenContext context, Expr val); 31 | 32 | #endregion 33 | 34 | #region Other 35 | 36 | protected abstract Type FieldType { get; } 37 | 38 | #endregion 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/HostArg.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace clojure.lang.CljCompiler.Ast 3 | { 4 | public class HostArg 5 | { 6 | #region Enum 7 | 8 | public enum ParameterType 9 | { 10 | Standard, 11 | ByRef 12 | } 13 | 14 | #endregion 15 | 16 | #region Data 17 | 18 | readonly ParameterType _paramType; 19 | 20 | public ParameterType ParamType 21 | { 22 | get { return _paramType; } 23 | } 24 | 25 | readonly Expr _argExpr; 26 | 27 | public Expr ArgExpr 28 | { 29 | get { return _argExpr; } 30 | } 31 | 32 | readonly LocalBinding _localBinding; 33 | 34 | public LocalBinding LocalBinding 35 | { 36 | get { return _localBinding; } 37 | } 38 | 39 | #endregion 40 | 41 | #region C-tors 42 | 43 | public HostArg(ParameterType paramType, Expr argExpr, LocalBinding lb) 44 | { 45 | _paramType = paramType; 46 | _argExpr = argExpr; 47 | _localBinding = lb; 48 | } 49 | 50 | #endregion 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/IParser.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang.CljCompiler.Ast 17 | { 18 | interface IParser 19 | { 20 | Expr Parse(ParserContext pcon, object form); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/IdentityHashMap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.Serialization; 4 | 5 | namespace clojure.lang.CljCompiler.Ast 6 | { 7 | [Serializable] 8 | public sealed class IdentityHashMap : Dictionary 9 | { 10 | class RefCmp : IEqualityComparer 11 | { 12 | #region IEqualityComparer Members 13 | 14 | public new bool Equals(Object x, Object y) 15 | { 16 | return Object.ReferenceEquals(x, y); 17 | } 18 | 19 | public int GetHashCode(object obj) 20 | { 21 | return obj.GetHashCode(); 22 | } 23 | 24 | #endregion 25 | } 26 | 27 | public IdentityHashMap() 28 | : base(new RefCmp()) 29 | { 30 | } 31 | 32 | private IdentityHashMap(SerializationInfo info, StreamingContext context) 33 | : base(info, context) 34 | { 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/KeywordExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | namespace clojure.lang.CljCompiler.Ast 24 | { 25 | class KeywordExpr : LiteralExpr 26 | { 27 | #region Data 28 | 29 | readonly Keyword _kw; 30 | 31 | public Keyword Kw 32 | { 33 | get { return _kw; } 34 | } 35 | 36 | 37 | #endregion 38 | 39 | #region Ctors 40 | 41 | public KeywordExpr(Keyword kw) 42 | { 43 | _kw = kw; 44 | } 45 | 46 | #endregion 47 | 48 | #region Type mangling 49 | 50 | public override bool HasClrType 51 | { 52 | get { return true; } 53 | } 54 | 55 | public override Type ClrType 56 | { 57 | get { return typeof(Keyword); } 58 | } 59 | 60 | #endregion 61 | 62 | #region Code generation 63 | 64 | public override Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 65 | { 66 | return objx.GenKeyword(context,_kw); 67 | } 68 | 69 | #endregion 70 | 71 | #region LiteralExpr methods 72 | 73 | public override object Val 74 | { 75 | get { return _kw; } 76 | } 77 | 78 | #endregion 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/LiteralExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | #if CLR2 17 | using Microsoft.Scripting.Ast; 18 | #else 19 | using System.Linq.Expressions; 20 | #endif 21 | 22 | namespace clojure.lang.CljCompiler.Ast 23 | { 24 | abstract class LiteralExpr : Expr 25 | { 26 | public abstract object Val { get; } 27 | 28 | #region Expr Members 29 | 30 | public object Eval() 31 | { 32 | return Val; 33 | } 34 | 35 | public abstract bool HasClrType { get; } 36 | public abstract Type ClrType { get; } 37 | public abstract Expression GenCode(RHC rhc, ObjExpr objx, GenContext context); 38 | 39 | #endregion 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/MaybePrimitiveExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | #if CLR2 17 | using Microsoft.Scripting.Ast; 18 | #else 19 | using System.Linq.Expressions; 20 | #endif 21 | 22 | namespace clojure.lang.CljCompiler.Ast 23 | { 24 | interface MaybePrimitiveExpr : Expr 25 | { 26 | bool CanEmitPrimitive { get; } 27 | Expression GenCodeUnboxed(RHC rhc, ObjExpr objx, GenContext context); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/MetaExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | 24 | namespace clojure.lang.CljCompiler.Ast 25 | { 26 | class MetaExpr : Expr 27 | { 28 | #region Data 29 | 30 | readonly Expr _expr; 31 | readonly Expr _meta; 32 | 33 | #endregion 34 | 35 | #region Ctors 36 | 37 | public MetaExpr(Expr expr, Expr meta) 38 | { 39 | _expr = expr; 40 | _meta = meta; 41 | } 42 | 43 | #endregion 44 | 45 | #region Type mangling 46 | 47 | public bool HasClrType 48 | { 49 | get { return _expr.HasClrType; } 50 | } 51 | 52 | public Type ClrType 53 | { 54 | get { return _expr.ClrType; } 55 | } 56 | 57 | #endregion 58 | 59 | #region eval 60 | 61 | public object Eval() 62 | { 63 | return ((IObj)_expr.Eval()).withMeta((IPersistentMap)_meta.Eval()); 64 | } 65 | 66 | #endregion 67 | 68 | #region Code generation 69 | 70 | public Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 71 | { 72 | Expression objExpr = _expr.GenCode(RHC.Expression, objx, context); 73 | Expression iobjExpr = Expression.Convert(objExpr, typeof(IObj)); 74 | 75 | Expression metaExpr = _meta.GenCode(RHC.Expression, objx, context); 76 | metaExpr = Expression.Convert(metaExpr, typeof(IPersistentMap)); 77 | 78 | Expression ret = Expression.Call(iobjExpr, Compiler.Method_IObj_withMeta, metaExpr); 79 | 80 | return ret; 81 | } 82 | 83 | #endregion 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/MethodParamExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | 24 | namespace clojure.lang.CljCompiler.Ast 25 | { 26 | sealed class MethodParamExpr : Expr, MaybePrimitiveExpr 27 | { 28 | #region Data 29 | 30 | readonly Type _t; 31 | 32 | #endregion 33 | 34 | #region C-tors 35 | 36 | public MethodParamExpr(Type t) 37 | { 38 | _t = t; 39 | } 40 | 41 | #endregion 42 | 43 | #region Type mangling 44 | 45 | public bool HasClrType 46 | { 47 | get { return _t != null; } 48 | } 49 | 50 | public Type ClrType 51 | { 52 | get { return _t; } 53 | } 54 | 55 | #endregion 56 | 57 | #region eval 58 | 59 | public object Eval() 60 | { 61 | throw new InvalidOperationException("Can't eval"); 62 | } 63 | 64 | #endregion 65 | 66 | #region Code generation 67 | 68 | public Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 69 | { 70 | throw new InvalidOperationException("Can't emit"); 71 | } 72 | 73 | #endregion 74 | 75 | #region MaybePrimitiveExpr Members 76 | 77 | public bool CanEmitPrimitive 78 | { 79 | get { return Util.IsPrimitive(_t); } 80 | } 81 | 82 | public Expression GenCodeUnboxed(RHC rhc, ObjExpr objx, GenContext context) 83 | { 84 | throw new InvalidOperationException("Can't emit"); 85 | } 86 | 87 | #endregion 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/MonitorEnterExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | #if CLR2 17 | using Microsoft.Scripting.Ast; 18 | #else 19 | using System.Linq.Expressions; 20 | #endif 21 | 22 | namespace clojure.lang.CljCompiler.Ast 23 | { 24 | class MonitorEnterExpr : UntypedExpr 25 | { 26 | #region Data 27 | 28 | readonly Expr _target; 29 | 30 | #endregion 31 | 32 | #region Ctors 33 | 34 | public MonitorEnterExpr(Expr target) 35 | { 36 | _target = target; 37 | } 38 | 39 | #endregion 40 | 41 | #region Parsing 42 | 43 | public sealed class Parser : IParser 44 | { 45 | public Expr Parse(ParserContext pcon, object form) 46 | { 47 | return new MonitorEnterExpr(Compiler.Analyze(pcon.SetRhc(RHC.Expression), RT.second(form))); 48 | } 49 | } 50 | 51 | #endregion 52 | 53 | #region eval 54 | 55 | public override object Eval() 56 | { 57 | throw new InvalidOperationException("Can't eval monitor-enter"); 58 | } 59 | 60 | #endregion 61 | 62 | #region Code generation 63 | 64 | public override Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 65 | { 66 | return Expression.Block( 67 | Expression.Call(Compiler.Method_Monitor_Enter, _target.GenCode(RHC.Expression, objx, context)), 68 | Compiler.NilExprInstance.GenCode(rhc, objx, context)); 69 | } 70 | 71 | #endregion 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/MonitorExitExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | #if CLR2 17 | using Microsoft.Scripting.Ast; 18 | #else 19 | using System.Linq.Expressions; 20 | #endif 21 | 22 | 23 | namespace clojure.lang.CljCompiler.Ast 24 | { 25 | class MonitorExitExpr : UntypedExpr 26 | { 27 | #region Data 28 | 29 | readonly Expr _target; 30 | 31 | #endregion 32 | 33 | #region Ctors 34 | 35 | public MonitorExitExpr(Expr target) 36 | { 37 | _target = target; 38 | } 39 | 40 | #endregion 41 | 42 | #region Parsing 43 | 44 | public sealed class Parser : IParser 45 | { 46 | public Expr Parse(ParserContext pcon, object form) 47 | { 48 | return new MonitorExitExpr(Compiler.Analyze(pcon.SetRhc(RHC.Expression),RT.second(form))); 49 | } 50 | } 51 | 52 | #endregion 53 | 54 | #region eval 55 | 56 | public override object Eval() 57 | { 58 | throw new InvalidOperationException("Can't eval monitor-exit"); 59 | } 60 | 61 | #endregion 62 | 63 | #region Code generation 64 | 65 | public override Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 66 | { 67 | return Expression.Block( 68 | Expression.Call(Compiler.Method_Monitor_Exit, _target.GenCode(RHC.Expression, objx, context)), 69 | Compiler.NilExprInstance.GenCode(rhc, objx, context)); 70 | } 71 | 72 | #endregion 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/NilExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | namespace clojure.lang.CljCompiler.Ast 24 | { 25 | class NilExpr : LiteralExpr 26 | { 27 | #region Data 28 | 29 | public override object Val 30 | { 31 | get { return null; } 32 | } 33 | 34 | #endregion 35 | 36 | #region Type mangling 37 | 38 | public override bool HasClrType 39 | { 40 | get { return true; } 41 | } 42 | 43 | public override Type ClrType 44 | { 45 | get { return null; } 46 | } 47 | 48 | #endregion 49 | 50 | #region Code generation 51 | 52 | public override Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 53 | { 54 | return Expression.Constant(null); 55 | } 56 | 57 | #endregion 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/Node.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using Microsoft.Scripting; 16 | 17 | namespace clojure.lang.CljCompiler.Ast 18 | { 19 | // TODO: Remove Node class 20 | 21 | /* 22 | /// 23 | /// Base class for AST expressions in the compiler. 24 | /// 25 | /// Stolen from IronPython. 26 | public abstract class Node 27 | { 28 | #region Data 29 | 30 | private Microsoft.Scripting.SourceLocation _start = SourceLocation.Invalid; 31 | private Microsoft.Scripting.SourceLocation _end = SourceLocation.Invalid; 32 | 33 | #endregion 34 | 35 | #region Location methods 36 | 37 | public void SetLoc(SourceLocation start, SourceLocation end) 38 | { 39 | _start = start; 40 | _end = end; 41 | } 42 | 43 | public void SetLoc(SourceSpan span) 44 | { 45 | _start = span.Start; 46 | _end = span.End; 47 | } 48 | 49 | public SourceLocation Start 50 | { 51 | get { return _start; } 52 | set { _start = value; } 53 | } 54 | 55 | public SourceLocation End 56 | { 57 | get { return _end; } 58 | set { _end = value; } 59 | } 60 | 61 | public SourceSpan Span 62 | { 63 | get 64 | { 65 | return new SourceSpan(_start, _end); 66 | } 67 | } 68 | 69 | #endregion 70 | } 71 | */ 72 | } 73 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/ParseException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Runtime.Serialization; 6 | 7 | namespace clojure.lang.CljCompiler.Ast 8 | { 9 | /// 10 | /// Exception thrown during parsing 11 | /// 12 | [Serializable] 13 | public class ParseException : Exception 14 | { 15 | public ParseException() 16 | { 17 | } 18 | 19 | public ParseException(string message) 20 | : base(message) 21 | { 22 | } 23 | 24 | public ParseException(string message, Exception innerException) 25 | : base(message, innerException) 26 | { 27 | } 28 | 29 | protected ParseException(SerializationInfo info, StreamingContext context) 30 | : base(info, context) 31 | { 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/StringExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | namespace clojure.lang.CljCompiler.Ast 24 | { 25 | class StringExpr : LiteralExpr 26 | { 27 | #region Data 28 | 29 | readonly string _str; 30 | 31 | public override object Val 32 | { 33 | get { return _str; } 34 | } 35 | 36 | #endregion 37 | 38 | #region Ctors 39 | 40 | public StringExpr(string str) 41 | { 42 | _str = str; 43 | } 44 | 45 | #endregion 46 | 47 | #region Type mangling 48 | 49 | public override bool HasClrType 50 | { 51 | get { return true; } 52 | } 53 | 54 | public override Type ClrType 55 | { 56 | get { return typeof(string); } 57 | } 58 | 59 | #endregion 60 | 61 | #region Code generation 62 | 63 | public override Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 64 | { 65 | return Expression.Constant(String.Intern(_str)); 66 | } 67 | 68 | #endregion 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/TheVarExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | 24 | namespace clojure.lang.CljCompiler.Ast 25 | { 26 | class TheVarExpr : Expr 27 | { 28 | #region Data 29 | 30 | readonly Var _var; 31 | 32 | #endregion 33 | 34 | #region Ctors 35 | 36 | public TheVarExpr(Var var) 37 | { 38 | _var = var; 39 | } 40 | 41 | #endregion 42 | 43 | #region Type mangling 44 | 45 | public bool HasClrType 46 | { 47 | get { return true; } 48 | } 49 | 50 | public Type ClrType 51 | { 52 | get { return typeof(Var); } 53 | } 54 | 55 | #endregion 56 | 57 | #region Parsing 58 | 59 | public sealed class Parser : IParser 60 | { 61 | public Expr Parse(ParserContext pcon, object form) 62 | { 63 | Symbol sym = (Symbol)RT.second(form); 64 | Var v = Compiler.LookupVar(sym, false); 65 | if (v != null) 66 | return new TheVarExpr(v); 67 | throw new ParseException(string.Format("Unable to resolve var: {0} in this context", sym)); 68 | } 69 | } 70 | 71 | #endregion 72 | 73 | #region eval 74 | 75 | public object Eval() 76 | { 77 | return _var; 78 | } 79 | 80 | #endregion 81 | 82 | #region Code generation 83 | 84 | public Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 85 | { 86 | return objx.GenVar(context,_var); 87 | } 88 | 89 | #endregion 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/ThrowExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | 24 | namespace clojure.lang.CljCompiler.Ast 25 | { 26 | class ThrowExpr : UntypedExpr 27 | { 28 | #region Data 29 | 30 | readonly Expr _excExpr; 31 | 32 | #endregion 33 | 34 | #region Ctors 35 | 36 | public ThrowExpr(Expr excExpr) 37 | { 38 | _excExpr = excExpr; 39 | } 40 | 41 | #endregion 42 | 43 | #region Parsing 44 | 45 | public sealed class Parser : IParser 46 | { 47 | public Expr Parse(ParserContext pcon, object form) 48 | { 49 | if (pcon.Rhc == RHC.Eval) 50 | return Compiler.Analyze(pcon, RT.list(RT.list(Compiler.FnSym, PersistentVector.EMPTY, form)), "throw__" + RT.nextID()); 51 | 52 | return new ThrowExpr(Compiler.Analyze(pcon.SetRhc(RHC.Expression).SetAssign(false), RT.second(form))); 53 | } 54 | } 55 | 56 | #endregion 57 | 58 | #region eval 59 | 60 | public override object Eval() 61 | { 62 | throw new InvalidOperationException("Can't eval throw"); 63 | } 64 | 65 | #endregion 66 | 67 | #region Code generation 68 | 69 | public override Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 70 | { 71 | Expression exc = _excExpr.GenCode(RHC.Expression, objx, context); 72 | Expression exc2 = Expression.Convert(exc, typeof(Exception)); 73 | 74 | return Expression.Throw(exc2,typeof(object)); 75 | } 76 | 77 | #endregion 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/UnresolvedVarExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | 23 | 24 | namespace clojure.lang.CljCompiler.Ast 25 | { 26 | class UnresolvedVarExpr : Expr 27 | { 28 | #region Data 29 | 30 | readonly Symbol _symbol; 31 | 32 | public Symbol Symbol 33 | { 34 | get { return _symbol; } 35 | } 36 | 37 | #endregion 38 | 39 | #region Ctors 40 | 41 | public UnresolvedVarExpr(Symbol symbol) 42 | { 43 | _symbol = symbol; 44 | } 45 | 46 | #endregion 47 | 48 | #region Type mangling 49 | 50 | public bool HasClrType 51 | { 52 | get { return false; } 53 | } 54 | 55 | public Type ClrType 56 | { 57 | get { throw new InvalidOperationException("UnresolvedVarExpr has no CLR type"); } 58 | } 59 | 60 | #endregion 61 | 62 | #region eval 63 | 64 | public object Eval() 65 | { 66 | throw new ArgumentException("UnresolvedVarExpr cannot be evalled"); 67 | } 68 | 69 | #endregion 70 | 71 | #region Code generation 72 | 73 | public Expression GenCode(RHC rhc, ObjExpr objx, GenContext context) 74 | { 75 | return Expression.Empty(); 76 | } 77 | 78 | #endregion 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Clojure/Clojure/CljCompiler/Ast/UntypedExpr.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | #if CLR2 19 | using Microsoft.Scripting.Ast; 20 | #else 21 | using System.Linq.Expressions; 22 | #endif 23 | using System.Text; 24 | 25 | 26 | namespace clojure.lang.CljCompiler.Ast 27 | { 28 | abstract class UntypedExpr : Expr 29 | { 30 | #region Expr Members 31 | 32 | public bool HasClrType 33 | { 34 | get { return false; } 35 | } 36 | 37 | public Type ClrType 38 | { 39 | get { throw new ArgumentException("Has no CLR type"); } 40 | } 41 | 42 | public abstract object Eval(); 43 | public abstract Expression GenCode(RHC rhc, ObjExpr objx, GenContext context); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Associative.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an immutable key/value mapping. 20 | /// 21 | public interface Associative: IPersistentCollection, ILookup 22 | { 23 | /// 24 | /// Test if the map contains a key. 25 | /// 26 | /// The key to test for membership 27 | /// True if the key is in this map. 28 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "contains")] 29 | bool containsKey(object key); 30 | 31 | /// 32 | /// Returns the key/value pair for this key. 33 | /// 34 | /// The key to retrieve 35 | /// The key/value pair for the key, or null if the key is not in the map. 36 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "entry")] 37 | IMapEntry entryAt(object key); 38 | 39 | /// 40 | /// Add a new key/value pair. 41 | /// 42 | /// The key 43 | /// The value 44 | /// A new map with the key/value added. 45 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "assoc")] 46 | Associative assoc(object key, object val); 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Box.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | 19 | // TODO: Replace Box: mostly this is used in the Java version in lieu of ref/out parameters. 20 | 21 | /// 22 | /// Boxes any value or reference. 23 | /// 24 | public class Box 25 | { 26 | /// 27 | /// The value being boxed. 28 | /// 29 | private object _val; 30 | 31 | /// 32 | /// Gets the boxed value. 33 | /// 34 | public object Val 35 | { 36 | get { return _val; } 37 | set { _val = value; } 38 | } 39 | 40 | /// 41 | /// Initializes a Box to the given value. 42 | /// 43 | /// 44 | public Box(object val) 45 | { 46 | _val = val; 47 | } 48 | 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ChunkBuffer.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public sealed class ChunkBuffer : Counted 19 | { 20 | #region Data 21 | 22 | object[] _buffer; 23 | int _end; 24 | 25 | #endregion 26 | 27 | #region C-tors 28 | 29 | public ChunkBuffer(int capacity) 30 | { 31 | _buffer = new object[capacity]; 32 | _end = 0; 33 | } 34 | 35 | #endregion 36 | 37 | #region Other 38 | 39 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 40 | public void add(object o) 41 | { 42 | _buffer[_end++] = o; 43 | } 44 | 45 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 46 | public IChunk chunk() 47 | { 48 | ArrayChunk ret = new ArrayChunk(_buffer, 0, _end); 49 | _buffer = null; 50 | return ret; 51 | } 52 | 53 | #endregion 54 | 55 | #region Counted Members 56 | 57 | public int count() 58 | { 59 | return _end; 60 | } 61 | 62 | #endregion 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ClojureException.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Runtime.Serialization; 17 | 18 | namespace clojure.lang 19 | { 20 | [Serializable] 21 | public class ClojureException : Exception 22 | { 23 | public ClojureException() 24 | { 25 | } 26 | 27 | public ClojureException(string msg) 28 | : base(msg) 29 | { 30 | } 31 | 32 | public ClojureException(string msg, Exception innerException) 33 | : base(msg, innerException) 34 | { 35 | } 36 | 37 | protected ClojureException(SerializationInfo info, StreamingContext context) 38 | : base(info, context) 39 | { 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Counted.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// A promise that the class is a collection that implements a constant-time count(). 20 | /// 21 | public interface Counted 22 | { 23 | /// 24 | /// Gets the number of items in the collection. 25 | /// 26 | /// The number of items in the collection. 27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 28 | int count(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Fn.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Marks an object that can be used in a functional position in a Clojure form. 20 | /// 21 | public interface Fn 22 | { 23 | // marker interface 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IBlockingDeref.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | namespace clojure.lang 18 | { 19 | public interface IBlockingDeref 20 | { 21 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "deref")] 22 | object deref(long ms, Object timeoutValue); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IChunk.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface IChunk : Indexed 19 | { 20 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "drop")] 21 | IChunk dropFirst(); 22 | 23 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "reduce")] 24 | object reduce(IFn f, object start); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IChunkedSeq.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface IChunkedSeq : ISeq, Sequential 19 | { 20 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "chunked")] 21 | IChunk chunkedFirst(); 22 | 23 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "chunked")] 24 | ISeq chunkedNext(); 25 | 26 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "chunked")] 27 | ISeq chunkedMore(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IDeref.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents something that can dereference. 20 | /// 21 | public interface IDeref 22 | { 23 | /// 24 | /// Gets the (immutable) value the reference is holding. 25 | /// 26 | /// The value 27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "deref")] 28 | object deref(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IEditableCollection.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface IEditableCollection 19 | { 20 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 21 | ITransientCollection asTransient(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IFnArity.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace clojure.lang 21 | { 22 | /// 23 | /// Interface supporting an IFn reporting what arities is supports 24 | /// 25 | public interface IFnArity 26 | { 27 | bool HasArity(int arity); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IHashEq.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace clojure.lang 21 | { 22 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Eq")] 23 | public interface IHashEq 24 | { 25 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "hasheq")] 26 | int hasheq(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IKeywordLookup.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface IKeywordLookup 19 | { 20 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "get")] 21 | ILookupThunk getLookupThunk(Keyword k); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ILookup.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an object that supports value lookup by key. 20 | /// 21 | public interface ILookup 22 | { 23 | /// 24 | /// Gets the value associated with a key. 25 | /// 26 | /// The key to look up. 27 | /// The associated value. (Throws an exception if key is not present.) 28 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 29 | object valAt(object key); 30 | 31 | /// 32 | /// Gets the value associated with a key. 33 | /// 34 | /// The key to look up. 35 | /// The value to return if the key is not present. 36 | /// The associated value (or notFound if the key is not present. 37 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 38 | object valAt(object key, object notFound); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ILookupSite.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | 12 | namespace clojure.lang 13 | { 14 | public interface ILookupSite 15 | { 16 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "fault")] 17 | ILookupThunk fault(object target); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ILookupThunk.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | 19 | public interface ILookupThunk 20 | { 21 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] 22 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "get")] 23 | object get(object target); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IMapEntry.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Defines a key/value pair. Immutable. 20 | /// 21 | /// 22 | /// Lowercase-named methods for JVM compatibility. 23 | /// In JVM version, this interface extends Map.Entry. The equivalent BCL type is either KeyValuePair 24 | /// or DictionaryEntry 25 | /// both of which are structs and hence can't be derived from. 26 | /// 27 | public interface IMapEntry 28 | { 29 | /// 30 | /// Get the key in a key/value pair. 31 | /// 32 | /// The key. 33 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 34 | object key(); 35 | 36 | /// 37 | /// Get the value in a key/value pair. 38 | /// 39 | /// The value. 40 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 41 | object val(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IMeta.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an object that can have metadata attached. 20 | /// 21 | public interface IMeta 22 | { 23 | /// 24 | /// Gets the metadata attached to the object. 25 | /// 26 | /// An immutable map representing the object's metadata. 27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 28 | IPersistentMap meta(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IObj.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an object that creates a copy with new metadata. 20 | /// 21 | public interface IObj : IMeta 22 | { 23 | /// 24 | /// Create a copy with new metadata. 25 | /// 26 | /// The new metadata. 27 | /// A copy of the object with new metadata attached. 28 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "with")] 29 | IObj withMeta(IPersistentMap meta); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IPending.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | 18 | namespace clojure.lang 19 | { 20 | public interface IPending 21 | { 22 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "is")] 23 | bool isRealized(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IPersistentList.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an immutable list. (sequential + stack + collection) 20 | /// 21 | public interface IPersistentList: Sequential, IPersistentStack 22 | { 23 | // empty 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IPersistentStack.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an immutable collection with stack operations. 20 | /// 21 | public interface IPersistentStack: IPersistentCollection 22 | { 23 | /// 24 | /// Peek at the top (first) element in the stack. 25 | /// 26 | /// The top (first) element. 27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "peek")] 28 | object peek(); 29 | 30 | /// 31 | /// Returns a new stack with the top element popped. 32 | /// 33 | /// The new stack. 34 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "pop")] 35 | IPersistentStack pop(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IProxy.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface IProxy 19 | { 20 | 21 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")] 22 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "init")] 23 | void __initClojureFnMappings(IPersistentMap m); 24 | 25 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")] 26 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "update")] 27 | void __updateClojureFnMappings(IPersistentMap m); 28 | 29 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")] 30 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "get")] 31 | IPersistentMap __getClojureFnMappings(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IRecord.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | namespace clojure.lang 16 | { 17 | public interface IRecord 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IReduce.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents a collection that supports function mapping/reduction. 20 | /// 21 | public interface IReduce 22 | { 23 | /// 24 | /// Reduce the collection using a function. 25 | /// 26 | /// The function to apply. 27 | /// The reduced value 28 | /// Computes f(...f(f(f(i0,i1),i2),i3),...). 29 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "reduce")] 30 | object reduce(IFn f); 31 | 32 | 33 | /// 34 | /// Reduce the collection using a function. 35 | /// 36 | /// The function to apply. 37 | /// An initial value to get started. 38 | /// The reduced value 39 | /// Computes f(...f(f(f(start,i0),i1),i2),...). 40 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "reduce")] 41 | object reduce(IFn f, object start); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IReference.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an object with settable metadata. 20 | /// 21 | public interface IReference : IMeta 22 | { 23 | /// 24 | /// Alter the metadata on the object. 25 | /// 26 | /// A function to apply to generate the new metadata 27 | /// Arguments to apply the function to. 28 | /// The new metadata map. 29 | /// The new value will be the result of (apply alter (cons currentMeta args)). 30 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "alter")] 31 | IPersistentMap alterMeta(IFn alter, ISeq args); 32 | 33 | /// 34 | /// Set the metadata of the object. 35 | /// 36 | /// The new metadata map 37 | /// The new metadata map. 38 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "reset")] 39 | IPersistentMap resetMeta(IPersistentMap m); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ITransientAssociative.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface ITransientAssociative : ITransientCollection, ILookup 19 | { 20 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 21 | ITransientAssociative assoc(object key, object val); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ITransientCollection.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface ITransientCollection 19 | { 20 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "conj")] 21 | ITransientCollection conj(object val); 22 | 23 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "persistent")] 24 | IPersistentCollection persistent(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ITransientMap.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface ITransientMap : ITransientAssociative, Counted 19 | { 20 | /// 21 | /// Add a new key/value pair. 22 | /// 23 | /// The key 24 | /// The value 25 | /// A new map with key+value added. 26 | /// Overwrites an exising value for the , if present. 27 | new ITransientMap assoc(object key, object val); 28 | 29 | /// 30 | /// Remove a key entry. 31 | /// 32 | /// The key to remove 33 | /// A new map with the key removed (or the same map if the key is not contained). 34 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 35 | ITransientMap without(object key); 36 | 37 | new IPersistentMap persistent(); 38 | 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ITransientSet.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface ITransientSet : ITransientCollection, Counted 19 | { 20 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "disjoin")] 21 | ITransientSet disjoin(object key); 22 | 23 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "contains")] 24 | bool contains(object key); 25 | 26 | 27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] 28 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "get")] 29 | object get(object key); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/ITransientVector.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface ITransientVector : ITransientAssociative, Indexed 19 | { 20 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "assoc")] 21 | ITransientVector assocN(int i, object val); 22 | 23 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "pop")] 24 | ITransientVector pop(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IType.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | namespace clojure.lang 16 | { 17 | public interface IType 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Indexed.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | public interface Indexed : Counted 19 | { 20 | /// 21 | /// Returns the n-th item. 22 | /// 23 | /// Index of the item to access 24 | /// The item at the given index 25 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "nth")] 26 | object nth(int i); 27 | 28 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "nth")] 29 | object nth(int i, object notFound); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/IndexedSeq.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Indicates a sequence that has a current index. 20 | /// 21 | public interface IndexedSeq : ISeq, Sequential, Counted 22 | { 23 | /// 24 | /// Gets the index associated with this sequence. 25 | /// 26 | /// The index associated with this sequence. 27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "index")] 28 | int index(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/MapEquivalence.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | // marker interface 19 | public interface MapEquivalence 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Named.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an object that has a namespace/name. 20 | /// 21 | /// Lowercase-named methods for compatibility with the JVM implementation. 22 | public interface Named 23 | { 24 | /// 25 | /// Gets the namespace name for the object. 26 | /// 27 | /// The namespace name. 28 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "get")] 29 | string getNamespace(); 30 | 31 | /// 32 | /// Gets the name of the object 33 | /// 34 | /// The name. 35 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "get")] 36 | string getName(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Data")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Data")] 13 | [assembly: AssemblyCopyright("Copyright © 2008")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d1b1677b-88ab-4878-8a57-adedaeac78bd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Reversible.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents a sequence that can be traversed in reverse. 20 | /// 21 | public interface Reversible 22 | { 23 | /// 24 | /// Gets an ISeq to travers the sequence in reverse. 25 | /// 26 | /// An ISeq . 27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "rseq")] 28 | ISeq rseq(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Seqable.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an object that can produce an . 20 | /// 21 | public interface Seqable 22 | { 23 | /// 24 | /// Gets an to allow first/rest/next iteration through the collection. 25 | /// 26 | /// An for iteration. 27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] 28 | ISeq seq(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Sequential.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Marks the object as being a sequential collection. 20 | /// 21 | public interface Sequential 22 | { 23 | //empty 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Clojure/Clojure/Lib/Settable.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang 17 | { 18 | /// 19 | /// Represents an object with a value that can be set. 20 | /// 21 | public interface Settable 22 | { 23 | /// 24 | /// Sets the value. 25 | /// 26 | /// The new value 27 | /// The new value. 28 | /// Can only be called in a transaction or with a binding on the stack, else throws an exception. 29 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "do")] 30 | object doSet(object val); 31 | 32 | /// 33 | /// Sets the root value. 34 | /// 35 | /// The new value 36 | /// The new value. 37 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "do")] 38 | object doReset(object val); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Clojure/Clojure/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | using System.Reflection; 12 | using System.Runtime.InteropServices; 13 | 14 | // General Information about an assembly is controlled through the following 15 | // set of attributes. Change these attribute values to modify the information 16 | // associated with an assembly. 17 | [assembly: AssemblyTitle("Clojure")] 18 | [assembly: AssemblyDescription("")] 19 | [assembly: AssemblyConfiguration("")] 20 | [assembly: AssemblyCompany("")] 21 | [assembly: AssemblyProduct("Clojure")] 22 | [assembly: AssemblyCopyright("Copyright © 2009")] 23 | [assembly: AssemblyTrademark("")] 24 | [assembly: AssemblyCulture("")] 25 | 26 | // Setting ComVisible to false makes the types in this assembly not visible 27 | // to COM components. If you need to access a type in this assembly from 28 | // COM, set the ComVisible attribute to true on that type. 29 | [assembly: ComVisible(false)] 30 | 31 | // The following GUID is for the ID of the typelib if this project is exposed to COM 32 | [assembly: Guid("92a6be2b-759d-4d62-8912-9dde0052bc33")] 33 | 34 | // Version information for an assembly consists of the following four values: 35 | // 36 | // Major Version 37 | // Minor Version 38 | // Build Number 39 | // Revision 40 | // 41 | // You can specify all the values or you can default the Build and Revision Numbers 42 | // by using the '*' as shown below: 43 | // [assembly: AssemblyVersion("1.0.*")] 44 | [assembly: AssemblyVersion("1.4.0.0")] 45 | [assembly: AssemblyFileVersion("1.3")] 46 | 47 | [assembly: System.Resources.NeutralResourcesLanguage("en-US")] 48 | -------------------------------------------------------------------------------- /Clojure/Clojure/Resources/version.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richhickey/clojure-clr/2c7e20cd3c6ffc64b783ddb3cb7984fb93472ad4/Clojure/Clojure/Resources/version.txt -------------------------------------------------------------------------------- /Clojure/Clojure/Runtime/Binding/BindingHelpers.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | 17 | #if CLR2 18 | using Microsoft.Scripting.Ast; 19 | #else 20 | using System.Linq.Expressions; 21 | #endif 22 | using System.Reflection; 23 | using Microsoft.Scripting.Actions; 24 | using System.Dynamic; 25 | 26 | namespace clojure.lang.Runtime.Binding 27 | { 28 | static class BindingHelpers 29 | { 30 | static readonly PropertyInfo Property_ClojureContext_Default = typeof(ClojureContext).GetProperty("Default"); 31 | static readonly Expression _contextExpr = Expression.Property(null,Property_ClojureContext_Default); 32 | 33 | internal static Expression CreateBinderStateExpression() 34 | { 35 | return _contextExpr; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Clojure/Clojure/Runtime/Binding/IClojureConvertible.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | using System.Dynamic; 17 | 18 | namespace clojure.lang.Runtime.Binding 19 | { 20 | // Ripped off from IPy 21 | // Though it is pretty inevitable. 22 | // Many metaobject classes implement this in IronPython. 23 | // Because Clojure runs mostly on naked CLR objects, 24 | // the only metaobject class that needs this is above IFn, 25 | // primarily to support generic type inferencing, 26 | // or more generally conversion to delegate types. 27 | 28 | interface IClojureConvertible 29 | { 30 | //DynamicMetaObject BindConvert(ClojureConversionBinder binder); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Clojure/Clojure/Runtime/Binding/IClojureSite.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | 16 | namespace clojure.lang.Runtime.Binding 17 | { 18 | /// 19 | /// Gets the ClojureContext that the call site binder is associated with. 20 | /// 21 | interface IClojureSite 22 | { 23 | ClojureContext Context { get; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Clojure/Clojure/Runtime/ClojureOps.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using Microsoft.Scripting; 20 | 21 | namespace clojure.lang.Runtime 22 | { 23 | /// 24 | /// Contains functions that are called directly from 25 | /// generated code to perform low-level runtime functionality. 26 | /// 27 | public static class ClojureOps 28 | { 29 | // TODO: Scour gen code to find things to move here. 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Clojure/Clojure/Runtime/ClojureOptions.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.ObjectModel; 17 | using System.Collections.Generic; 18 | 19 | using Microsoft.Scripting; 20 | 21 | 22 | namespace clojure.lang.Runtime 23 | { 24 | [Serializable] 25 | public sealed class ClojureOptions : LanguageOptions 26 | { 27 | private readonly ReadOnlyCollection _arguments; 28 | 29 | 30 | /// 31 | /// Gets the collection of command line arguments. 32 | /// 33 | public ReadOnlyCollection/*!*/ Arguments 34 | { 35 | get { return _arguments; } 36 | } 37 | 38 | 39 | public ClojureOptions() 40 | : this(null) 41 | { 42 | } 43 | 44 | public ClojureOptions(IDictionary options) 45 | :base(options) 46 | { 47 | _arguments = GetStringCollectionOption(options, "Arguments") ?? EmptyStringCollection; 48 | } 49 | 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Clojure/Clojure/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Clojure/Clojure/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Clojure/DlrConsole/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Clojure/DlrConsole/Program.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Rich Hickey. All rights reserved. 3 | * The use and distribution terms for this software are covered by the 4 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 5 | * which can be found in the file epl-v10.html at the root of this distribution. 6 | * By using this software in any fashion, you are agreeing to be bound by 7 | * the terms of this license. 8 | * You must not remove this notice, or any other, from this software. 9 | **/ 10 | 11 | /** 12 | * Author: David Miller 13 | **/ 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using Microsoft.Scripting.Hosting; 20 | using clojure.lang.Runtime; 21 | 22 | namespace DlrConsole 23 | { 24 | class Program 25 | { 26 | static void Main(string[] args) 27 | { 28 | //ScriptRuntime env = ScriptRuntime.CreateFromConfiguration(); 29 | ScriptRuntimeSetup setup = new ScriptRuntimeSetup(); 30 | LanguageSetup lsetup = new LanguageSetup( 31 | typeof(ClojureContext).AssemblyQualifiedName, 32 | ClojureContext.ClojureDisplayName, 33 | ClojureContext.ClojureNames.Split(new Char[]{';'}), 34 | ClojureContext.ClojureFileExtensions.Split(new Char[] { ';' })); 35 | 36 | 37 | setup.LanguageSetups.Add(lsetup); 38 | ScriptRuntime env = new ScriptRuntime(setup); 39 | 40 | ScriptEngine curEngine = env.GetEngine("clj"); 41 | Console.WriteLine("CurrentEngine: {0}", curEngine.LanguageVersion.ToString()); 42 | ScriptScope scope = curEngine.CreateScope(); 43 | Console.WriteLine("Scope: {0}", scope.GetItems()); 44 | Console.ReadLine(); 45 | 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Clojure/DlrConsole/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DlrConsole")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("DePaul University")] 12 | [assembly: AssemblyProduct("DlrConsole")] 13 | [assembly: AssemblyCopyright("Copyright © DePaul University 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9380afc3-585c-4f4e-8c30-d54c7ff395a3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Clojure/Simple.Console/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Simple.Console")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Simple.Console")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2ebfb04e-e46e-4146-9fba-0ed41df0111e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /docs/CompilerContextAnalysis.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richhickey/clojure-clr/2c7e20cd3c6ffc64b783ddb3cb7984fb93472ad4/docs/CompilerContextAnalysis.xlsx -------------------------------------------------------------------------------- /docs/Simple-JVM-CLR-comparison.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richhickey/clojure-clr/2c7e20cd3c6ffc64b783ddb3cb7984fb93472ad4/docs/Simple-JVM-CLR-comparison.docx -------------------------------------------------------------------------------- /docs/TestJavaFormat/build/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richhickey/clojure-clr/2c7e20cd3c6ffc64b783ddb3cb7984fb93472ad4/docs/TestJavaFormat/build/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /docs/TestJavaFormat/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /docs/TestJavaFormat/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=d2202972 2 | build.xml.script.CRC32=10364f00 3 | build.xml.stylesheet.CRC32=958a1d3e 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=d2202972 7 | nbproject/build-impl.xml.script.CRC32=a1e7f111 8 | nbproject/build-impl.xml.stylesheet.CRC32=65b8de21 9 | -------------------------------------------------------------------------------- /docs/TestJavaFormat/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | jaxws.endorsed.dir=C:\\Program Files\\NetBeans 6.5.1\\java2\\modules\\ext\\jaxws21\\api:C:\\Program Files\\NetBeans 6.5.1\\ide10\\modules\\ext\\jaxb\\api 3 | user.properties.file=C:\\Documents and Settings\\David Miller\\.netbeans\\6.5\\build.properties 4 | -------------------------------------------------------------------------------- /docs/TestJavaFormat/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | build.classes.dir=${build.dir}/classes 2 | build.classes.excludes=**/*.java,**/*.form 3 | # This directory is removed when the project is cleaned: 4 | build.dir=build 5 | build.generated.dir=${build.dir}/generated 6 | # Only compile against the classpath explicitly listed here: 7 | build.sysclasspath=ignore 8 | build.test.classes.dir=${build.dir}/test/classes 9 | build.test.results.dir=${build.dir}/test/results 10 | # Uncomment to specify the preferred debugger connection transport: 11 | #debug.transport=dt_socket 12 | debug.classpath=\ 13 | ${run.classpath} 14 | debug.test.classpath=\ 15 | ${run.test.classpath} 16 | # This directory is removed when the project is cleaned: 17 | dist.dir=dist 18 | dist.jar=${dist.dir}/TestJavaFormat.jar 19 | dist.javadoc.dir=${dist.dir}/javadoc 20 | excludes= 21 | includes=** 22 | jar.compress=false 23 | javac.classpath= 24 | # Space-separated list of extra javac options 25 | javac.compilerargs= 26 | javac.deprecation=false 27 | javac.source=1.5 28 | javac.target=1.5 29 | javac.test.classpath=\ 30 | ${javac.classpath}:\ 31 | ${build.classes.dir}:\ 32 | ${libs.junit.classpath}:\ 33 | ${libs.junit_4.classpath} 34 | javadoc.additionalparam= 35 | javadoc.author=false 36 | javadoc.encoding=${source.encoding} 37 | javadoc.noindex=false 38 | javadoc.nonavbar=false 39 | javadoc.notree=false 40 | javadoc.private=false 41 | javadoc.splitindex=true 42 | javadoc.use=true 43 | javadoc.version=false 44 | javadoc.windowtitle= 45 | main.class=testjavaformat.Main 46 | manifest.file=manifest.mf 47 | meta.inf.dir=${src.dir}/META-INF 48 | platform.active=default_platform 49 | run.classpath=\ 50 | ${javac.classpath}:\ 51 | ${build.classes.dir} 52 | # Space-separated list of JVM arguments used when running the project 53 | # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value 54 | # or test-sys-prop.name=value to set system properties for unit tests): 55 | run.jvmargs= 56 | run.test.classpath=\ 57 | ${javac.test.classpath}:\ 58 | ${build.test.classes.dir} 59 | source.encoding=UTF-8 60 | src.dir=src 61 | test.src.dir=test 62 | -------------------------------------------------------------------------------- /docs/TestJavaFormat/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | TestJavaFormat 7 | 1.6.5 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/new-issues-2009-10-04.txt: -------------------------------------------------------------------------------- 1 | Improve use of threads in Agent code. 2 | Right now, just starting our own threads and forgetting it. We need to manage a thread pool. 3 | Also, shutdown not implemented. 4 | 5 | 6 | 7 | ### Verify use of methods in ArrayHelper. Add missing methods for other primitive types. 8 | ### ArrayStream: check for rank of array > 1. 9 | ### ArrayStream: Get rid of instantiations of ArrayStreamBase. 10 | ### Get rid of NumberV0. 11 | ### Get rid of DLR hosting methods that aren't being used. 12 | ### Change alpha designation on readme page. 13 | 14 | 15 | 16 | 17 | Compiler.GenerateAST: Get rid of extra (fn* [] form) wrapper. Copy how the JVM version does it (if possible). 18 | 19 | Compiler: compile lambdas to specific delegate type so we can use Invoke instead of DynamicInvoke. 20 | 21 | 22 | Get rid of RT.T and RT.F -- they serve no purpose in CLR. 23 | 24 | Define RT.LoadFileFn 25 | 26 | 27 | 28 | 29 | begin FxCop analysis 30 | 31 | 32 | Questions: 33 | 34 | ### Why do some implementations of withMeta check to see if the current meta equals new meta, and some do not? 35 | 36 | ### APersistentVector: 37 | ### Why does APersistentVector+RSeq implement Counted but APersistentVector+Seq does not? 38 | ### Why does APersistentVector+Seq implement IReduce by APersistetnVector+RSeq does not? 39 | ### 40 | ### What is the meaning of IndexedSeq.index on a reversed IndexedSeq? 41 | ### Should the index return the index relative to the original sequence or relative to the reversed sequence? 42 | ### Check out APersistentVector+RSeq. Why does it return _i instead of _length-_i-1? 43 | 44 | ### RT.stream 45 | ### else if (coll is Fn) // TODO: Note use of Fn to imply castable to IFn. Should we do this? Why not just check for IFn? 46 | ### return new Stream((IFn)coll); 47 | ### RT stream support: EmptyGen: Why is the invoke synchronized? 48 | 49 | -------------------------------------------------------------------------------- /docs/radix.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richhickey/clojure-clr/2c7e20cd3c6ffc64b783ddb3cb7984fb93472ad4/docs/radix.xlsx -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3 | 4 | ClojureCLR has a new home! 5 | 6 | Code repo: https://github.com/clojure/clojure-clr 7 | JIRA: http://dev.clojure.org/jira/browse/CLJCLR 8 | 9 | Old binary distributions for versions 1.1 and 1.2 will continue 10 | to be available here for the time being. 11 | 12 | The new github repo has 1.3 binaries. 13 | 14 | 15 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 16 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 17 | 18 | 19 | 20 | ClojureCLR 21 | 22 | This project is a native implementation of Clojure on the Common Language Runtime (CLR), 23 | the execution engine of Microsoft's .Net Framework. 24 | 25 | ClojureCLR is programmed in C# (and Clojure itself) and makes use of Microsoft's 26 | Dynamic Language Runtime (DLR). 27 | 28 | 29 | Goals: 30 | 31 | -- Implement a feature-complete Clojure on top of CLR/DLR. 32 | -- Stay as close as possible to the JVM implementation. 33 | -- Have some fun. 34 | 35 | -------------------------------------------------------------------------------------- 36 | 37 | Docs: http://clojure.org 38 | Feedback: http://groups.google.com/group/clojure 39 | Getting Started (general): http://dev.clojure.org/display/doc/Getting+Started 40 | 41 | 42 | For more information on ClojureCLR: http://github.com/richhickey/clojure-clr/wiki 43 | 44 | 45 | Installing ClojureCLR: 46 | 47 | To just run ClojureCLR, use the binary distribution: 48 | 49 | http://github.com/richhickey/clojure-clr/wiki/Getting-started-binary-distribution 50 | 51 | For a deeper look, get a source distribution: 52 | 53 | http://github.com/richhickey/clojure-clr/wiki/Getting-started-source-distribution 54 | 55 | 56 | -------------------------------------------------------------------------------------- 57 | 58 | * ClojureCLR 59 | * Copyright (c) Rich Hickey. All rights reserved. 60 | * The use and distribution terms for this software are covered by the 61 | * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 62 | * which can be found in the file epl-v10.html at the root of this distribution. 63 | * By using this software in any fashion, you are agreeing to be bound by 64 | * the terms of this license. 65 | * You must not remove this notice, or any other, from this software. 66 | 67 | 68 | 69 | 70 | --------------------------------------------------------------------------------