Anonymous avatar Anonymous committed b9ec842

Renamed jack/plug to fix/pad.

Comments (0)

Files changed (5)

   Nx library.  If you still need them Cf versions, you can restore them by a
   simple edit of the Makefile.
 + Changed type of [Cf_gadget.null] to a monad.  Added some additional monads.
++ Renamed [jack] and [plug] to [fix] and [pad], for cosmetic reasons.
 
 --- [Cf_gadget]
     The [null] object is now a monad that producs a null wire.  New [connect]
     and [connectpair] functions are generalizations of the [simplex] and
-    [duplex] functions.
-    
+    [duplex] functions.  Renamed [jack] to [fix].  Renamed [plug] to [pad].
+    Renamed [gates] to [gate].
 
 ===== Version 0.9 =====
 
 
 type ('i, 'o, 'a) t = (('i, 'o) work, 'a) Cf_cmonad.t
 and ('i, 'o) work = (('i, 'o) state, ('i, 'o) Cf_flow.t, unit) Cf_scmonad.t
-and ('i, 'o) gates = (wref * (Obj.t -> ('i, 'o, unit) t)) Cf_seq.t
+and ('i, 'o) gate = (wref * (Obj.t -> ('i, 'o, unit) t)) Cf_seq.t
 and ('i, 'o) state = {
     wireN: int;
     freeWireQ: int Cf_deque.t;
     wirePtrQ: (int * wref Weak.t) Cf_deque.t;
     msgQM: Obj.t Cf_deque.t IMap.t;
     readyQ: ('i, 'o) work Cf_deque.t;
-    guardQ: ('i, 'o) gates Cf_deque.t;
+    guardQ: ('i, 'o) gate Cf_deque.t;
     inputQ: ('i -> ('i, 'o) work) Cf_deque.t;
 }
 
 type ('x, 'i, 'o) wire = wref * wref
 
-type ('i, 'o, 'a) guard = (('i, 'o) gates, 'a) Cf_cmonad.t
+type ('i, 'o, 'a) guard = (('i, 'o) gate, 'a) Cf_cmonad.t
 
 open Cf_scmonad.Op
 
 
 type ('i, 'o) gateloop =
     | L_ready of Obj.t Cf_deque.t IMap.t * ('i, 'o) work
-    | L_pending of ('i, 'o) gates
+    | L_pending of ('i, 'o) gate
     | L_discard
 
 let rec scheduler_ Void =
 let connect m c = m (fun w -> c (new rx w, new tx w))
 let simplex c = connect wire c
 
-type ('x, 'y, 'i, 'o) plug = ('x, 'i, 'o) rx * ('y, 'i, 'o) tx
-type ('x, 'y, 'i, 'o) jack = ('y, 'i, 'o) rx * ('x, 'i, 'o) tx
+type ('x, 'y, 'i, 'o) pad = ('x, 'i, 'o) rx * ('y, 'i, 'o) tx
+type ('x, 'y, 'i, 'o) fix = ('y, 'i, 'o) rx * ('x, 'i, 'o) tx
 
 let connectpair m c =
     let f (a, b) = c ((new rx a, new tx b), (new rx b, new tx a)) in
 *)
 type ('i, 'o) work
 
-(** A sequence of gates for receiving messages using the [guard] function. *)
-type ('i, 'o) gates
+(** A gating sequence for receiving messages using the [guard] function. *)
+type ('i, 'o) gate
 
 (** An object capable of delivering messages of type ['x] from a sender to a
     a receiver in a [('i, 'o) work] continuation.
 type ('x, 'i, 'o) wire
 
 (** A guard for receiving a message from one or more sources. *)
-type ('i, 'o, 'a) guard = (('i, 'o) gates, 'a) Cf_cmonad.t
+type ('i, 'o, 'a) guard = (('i, 'o) gate, 'a) Cf_cmonad.t
 
 (** A continuation monad parameterized by work unit type. *)
 type ('i, 'o, 'a) t = (('i, 'o) work, 'a) Cf_cmonad.t
 val simplex: ('i, 'o, ('x, 'i, 'o) rx * ('x, 'i, 'o) tx) t
 
 (** A pair of convenience types for representing each end of a bundle of two
-    wires used for duplex communication.  By convention, a plug comprises a
+    wires used for duplex communication.  By convention, a [pad] comprises a
     receiver for control events and a transmitter for notification events, and
-    a jack comprises the transmitter for control events and the receiver for
+    a [fix] comprises the transmitter for control events and the receiver for
     notification events
 *)
-type ('x, 'y, 'i, 'o) plug = ('x, 'i, 'o) rx * ('y, 'i, 'o) tx
-type ('x, 'y, 'i, 'o) jack = ('y, 'i, 'o) rx * ('x, 'i, 'o) tx
+type ('x, 'y, 'i, 'o) pad = ('x, 'i, 'o) rx * ('y, 'i, 'o) tx
+type ('x, 'y, 'i, 'o) fix = ('y, 'i, 'o) rx * ('x, 'i, 'o) tx
 
 (** Use [connectpair m] to construct a new duplex communication channel,
-    composed with the wire pair returned by [m].  A matching jack and plug of
+    composed with the wire pair returned by [m].  A matching [fix] and [pad] of
     the channel are returned.
 *)
 val connectpair:
     ('i, 'o, ('x, 'i, 'o) wire * ('y, 'i, 'o) wire) t ->
-    ('i, 'o, ('x, 'y, 'i, 'o) jack * ('x, 'y, 'i, 'o) plug) t
+    ('i, 'o, ('x, 'y, 'i, 'o) fix * ('x, 'y, 'i, 'o) pad) t
 
 (** Use [duplex] to construct a new duplex communication channel, composed of
-    two wires each in opposite flow.  A matching jack and plug of the channel
-    are returned.  This is a convenient abbreviation of [connectpair wirepair].
+    two wires each in opposite flow.  A matching [fix] and [pad] for each
+    channel are returned.  This is a convenient abbreviation of
+    [connectpair wirepair].
 *)
-val duplex: ('i, 'o, ('x, 'y, 'i, 'o) jack * ('x, 'y, 'i, 'o) plug) t
+val duplex: ('i, 'o, ('x, 'y, 'i, 'o) fix * ('x, 'y, 'i, 'o) pad) t
 
 (** Use [wrap rx tx w] to start a new gadget that wraps the flow [w], so that
     it reads output from the flow (copying it to [tx] object) and writes input
     end
 
 (** Use [create f] to create a duplex channel, and apply [f] to the resulting
-    plug to obtain the initial state of a machine.  The machine is started and
-    the corresponding jack is returned.
+    [pad] to obtain the initial state of a machine.  The machine is started and
+    the corresponding [fix] is returned.
 *)
 val create:
-    (('c, 'n, 'i, 'o) plug -> ('i, 'o) #start) ->
-    ('i, 'o, ('c, 'n, 'i, 'o) jack) t
+    (('c, 'n, 'i, 'o) pad -> ('i, 'o) #start) ->
+    ('i, 'o, ('c, 'n, 'i, 'o) fix) t
 
 (** Use [createM f] to create a duplex channel, and apply [f] to the resulting
-    plug to obtain a continuation monad that evaluates to the initial state of
-    a machine.  The machine is started and the corresponding jack is returned.
+    [pad] to obtain a continuation monad that evaluates to the initial state of
+    a machine.  The machine is started and the corresponding [fix] is returned.
 *)
 val createM:
-    (('c, 'n, 'i, 'o) plug -> ('i, 'o, ('i, 'o) #start) t) ->
-    ('i, 'o, ('c, 'n, 'i, 'o) jack) t
+    (('c, 'n, 'i, 'o) pad -> ('i, 'o, ('i, 'o) #start) t) ->
+    ('i, 'o, ('c, 'n, 'i, 'o) fix) t
 
 (*--- End of File [ cf_gadget.mli ] ---*)

cf/cf_state_gadget.ml

 
 let simplex c = wire (fun w -> c (new rx w, new tx w))
 
-type ('x, 'y, 'i, 'o) plug = ('x, 'i, 'o) rx * ('y, 'i, 'o) tx
-type ('x, 'y, 'i, 'o) jack = ('y, 'i, 'o) rx * ('x, 'i, 'o) tx
+type ('x, 'y, 'i, 'o) pad = ('x, 'i, 'o) rx * ('y, 'i, 'o) tx
+type ('x, 'y, 'i, 'o) fix = ('y, 'i, 'o) rx * ('x, 'i, 'o) tx
 
 let duplex c =
     wirepair (fun (a, b) -> c ((new rx a, new tx b), (new rx b, new tx a)))

cf/cf_state_gadget.mli

 (** A pair of convenience types for representing each end of a bundle of two
     wires used for duplex communication.
 *)
-type ('x, 'y, 'i, 'o) plug = ('x, 'i, 'o) rx * ('y, 'i, 'o) tx
-type ('x, 'y, 'i, 'o) jack = ('y, 'i, 'o) rx * ('x, 'i, 'o) tx
+type ('x, 'y, 'i, 'o) pad = ('x, 'i, 'o) rx * ('y, 'i, 'o) tx
+type ('x, 'y, 'i, 'o) fix = ('y, 'i, 'o) rx * ('x, 'i, 'o) tx
 
 (** Use [duplex] to construct a new duplex communication channel, composed of
     two wires each in opposite flow.  A matching head and tail of the channel
     is returned.
 *)
-val duplex: ('s, 'i, 'o, ('x, 'y, 'i, 'o) plug * ('x, 'y, 'i, 'o) jack) t
+val duplex: ('s, 'i, 'o, ('x, 'y, 'i, 'o) pad * ('x, 'y, 'i, 'o) fix) t
 
 (** Use [wrap rx tx w] to start a new process that wraps the flow [w], so that
     it reads output from the flow (copying it to [tx] object) and writes input
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.