diff options
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/Function.scala.tmpl | 15 | ||||
-rw-r--r-- | sources/scala/Tuple.scala.tmpl | 15 | ||||
-rw-r--r-- | sources/scala/Tuple.scm | 49 | ||||
-rw-r--r-- | sources/scala/Tuple.tmpl | 24 |
4 files changed, 0 insertions, 103 deletions
diff --git a/sources/scala/Function.scala.tmpl b/sources/scala/Function.scala.tmpl deleted file mode 100644 index 83d0c99c27..0000000000 --- a/sources/scala/Function.scala.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2004, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - -package scala; - -trait Function{#n#}{#ClassSignature#} extends AnyRef { - def apply{#ApplySignature#}; -} diff --git a/sources/scala/Tuple.scala.tmpl b/sources/scala/Tuple.scala.tmpl deleted file mode 100644 index 54c75728f4..0000000000 --- a/sources/scala/Tuple.scala.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - -package scala; - -case class Tuple{#n#}[{#TParams#}]({#VParams#}) { - override def toString(): String = "(" + {#ToStringBody#} + ")"; -} diff --git a/sources/scala/Tuple.scm b/sources/scala/Tuple.scm deleted file mode 100644 index 081690b08b..0000000000 --- a/sources/scala/Tuple.scm +++ /dev/null @@ -1,49 +0,0 @@ -;; This rule file defines the environment for the expansion of -;; Tuple.tmpl template. -;; -;; It defines the following variables: -;; -;; Name Meaning Value for Tuple2 -;; ----------------------------------------------------- -;; n Arity of the tuple 2 -;; type-params Type parameters [T1, T2] -;; value-params Value parameters _1: T1, _2: T2 -;; equal Equality test (_1 == that._1) && (_2 == that._2) -;; hash-code Body of hashCode() _1.hashCode() ^ _2.hashCode() -;; to-string Body of toString() "(" + _1 + "," + _2 + ")" - -(define (repeated-string f n sep) - (string-join (map f (list-tabulate n (lambda (x) (+ x 1)))) sep)) - -(define (make-type-params n) - (string-append "[" (repeated-string (lambda (i) (format #f "T~a" i)) n ", ") "]")) - -(define (make-value-params n) - (repeated-string (lambda (i) (format #f "_~a: T~a" i i)) n ", ")) - -(define (make-equal n) - (repeated-string (lambda (i) (format #f "(_~a == that._~a)" i i)) n " && ")) - -(define (make-hash-code n) - (repeated-string (lambda (i) (format #f "_~a.hashCode()" i)) n " ^ ")) - -(define (make-to-string n) - (string-append - "\"(\" + " - (repeated-string (lambda (i) (format #f "_~a" i)) n " + \",\" + ") - " + \")\"")) - -(define file-name-rx (rx "Tuple" (submatch (+ digit)) ".scala")) - -(define (make-env target-file) - (let ((match (regexp-search file-name-rx target-file))) - (if match - (let ((n (string->number (match:substring match 1)))) - (list (cons 'n (number->string n)) - (cons 'type-params (make-type-params n)) - (cons 'value-params (make-value-params n)) - (cons 'equal (make-equal n)) - (cons 'hash-code (make-hash-code n)) - (cons 'to-string (make-to-string n)))) - (error "invalid file name" target-file)))) - diff --git a/sources/scala/Tuple.tmpl b/sources/scala/Tuple.tmpl deleted file mode 100644 index 59170a251d..0000000000 --- a/sources/scala/Tuple.tmpl +++ /dev/null @@ -1,24 +0,0 @@ -// [#do-not-edit#] - -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala { - case class Tuple[#n#][#type-params#]([#value-params#]) extends scala.Object { - - override def hashCode() = [#hash-code#]; - - override def equals (other: Any) = - if (other is Tuple[#n#][#type-params#]) { - val that = other as Tuple[#n#][#type-params#]; - [#equal#] - } else false; - - override def toString() = [#to-string#]; - } -} |