aboutsummaryrefslogtreecommitdiff
path: root/input/lux/data/bounded.lux
diff options
context:
space:
mode:
authorEduardo Julian2015-07-12 21:04:56 -0400
committerEduardo Julian2015-07-12 21:04:56 -0400
commit658ff3e1e7d90ce72c8a02ef4cf7e177d8ac6f86 (patch)
tree4ee6b9c0727a7619b1ebb2a50c9db17ada6a35c0 /input/lux/data/bounded.lux
parente351122010b5eb5bf8793382a4a4ddcf5fb3a386 (diff)
- Added the beginnings of the standard library.
- Fixed several bugs.
Diffstat (limited to 'input/lux/data/bounded.lux')
-rw-r--r--input/lux/data/bounded.lux26
1 files changed, 26 insertions, 0 deletions
diff --git a/input/lux/data/bounded.lux b/input/lux/data/bounded.lux
new file mode 100644
index 000000000..14f4d2e86
--- /dev/null
+++ b/input/lux/data/bounded.lux
@@ -0,0 +1,26 @@
+## Copyright (c) Eduardo Julian. All rights reserved.
+## The use and distribution terms for this software are covered by the
+## Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+## which can be found in the file epl-v10.html at the root of this distribution.
+## By using this software in any fashion, you are agreeing to be bound by
+## the terms of this license.
+## You must not remove this notice, or any other, from this software.
+
+(;import lux)
+
+## Signatures
+(defsig #export (Bounded a)
+ (: a
+ top)
+
+ (: a
+ bottom))
+
+## Structure
+(do-template [<name> <type> <top> <bottom>]
+ [(defstruct #export <name> (Bounded <type>)
+ (def top <top>)
+ (def bottom <bottom>))]
+
+ [Int:Bounded Int (_jvm_getstatic java.lang.Long MAX_VALUE) (_jvm_getstatic java.lang.Long MIN_VALUE)]
+ [Real:Bounded Real (_jvm_getstatic java.lang.Double MAX_VALUE) (_jvm_getstatic java.lang.Double MIN_VALUE)])