aboutsummaryrefslogtreecommitdiff
path: root/input/lux/data/bounded.lux
diff options
context:
space:
mode:
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)])