~subsetpark/fugue

e9a69482942d91b95c1d8b92d42ebe671ff6c56e — Zach Smith 3 years ago 8f6abbf
fmt
1 files changed, 20 insertions(+), 20 deletions(-)

M fugue.janet
M fugue.janet => fugue.janet +20 -20
@@ 87,11 87,11 @@
  [name proto]
  (when (index-of (keyword name) (comp-aware-fields proto))
    (maclintf
     :normal
     (string "you are defining a method named %s on the prototype %s; "
             "there is a field of the same name on that prototype.")
     (string name)
     (string proto))))
      :normal
      (string "you are defining a method named %s on the prototype %s; "
              "there is a field of the same name on that prototype.")
      (string name)
      (string proto))))

#
# defproto Forms


@@ 156,10 156,10 @@
       ',name
       (,string)
       (,base-proto
          ,defined-fields
          ,instance-defaults
          ,proto-allocated-fields
          ;(,kvs ,to-allocate))
         ,defined-fields
         ,instance-defaults
         ,proto-allocated-fields
         ;(,kvs ,to-allocate))
       (,table/setproto parent))))

(defn- init-form


@@ 275,9 275,9 @@
         (let [current-fields (,fields ,self)]
           (unless (,index-of ,key-field current-fields)
             (,errorf "type error: expected proto with field %q, got %s with fields: %q"
                ,key-field
                (in ,self :_name)
                current-fields)))
                      ,key-field
                      (in ,self :_name)
                      current-fields)))
         (,in ,self ,key-field)))))

(defmacro defproto


@@ 413,8 413,8 @@
          method-name (keyword name)
          final-case (case body
                       [raise-sentinel] ~(,errorf
                                            ,err-msg
                                            ,wrapper-args)
                                           ,err-msg
                                           ,wrapper-args)
                       ~(fn ,args ,;body))]
      ~(defn ,name
         ,docstring


@@ 462,12 462,12 @@
        (let [method-name (keyword name)
              full-method-name (symbol proto "-" name)]
          ~(,put ,proto
              ,method-name
              (fn ,full-method-name
                ,args
                (let [__parent (table/getproto ,proto)
                      __super (__parent ,method-name)]
                  ,;body))))])))
                 ,method-name
                 (fn ,full-method-name
                   ,args
                   (let [__parent (table/getproto ,proto)
                         __super (__parent ,method-name)]
                     ,;body))))])))

#
# Multimethod Helpers