[MLton-commit] r6185
Vesa Karvonen
vesak at mlton.org
Mon Nov 19 23:37:07 PST 2007
Renamed part -> partOf for slightly better readability.
----------------------------------------------------------------------
U mltonlib/trunk/org/mlton/vesak/tech/oo/framework/any.sig
U mltonlib/trunk/org/mlton/vesak/tech/oo/framework/any.sml
U mltonlib/trunk/org/mlton/vesak/tech/oo/framework/sub.fun
U mltonlib/trunk/org/mlton/vesak/tech/oo/imperative-shapes/README
U mltonlib/trunk/org/mlton/vesak/tech/oo/imperative-shapes/main.sml
----------------------------------------------------------------------
Modified: mltonlib/trunk/org/mlton/vesak/tech/oo/framework/any.sig
===================================================================
--- mltonlib/trunk/org/mlton/vesak/tech/oo/framework/any.sig 2007-11-20 03:01:53 UTC (rev 6184)
+++ mltonlib/trunk/org/mlton/vesak/tech/oo/framework/any.sig 2007-11-20 07:37:06 UTC (rev 6185)
@@ -6,7 +6,7 @@
signature ANY = sig
type 'a t
- val part : 'a t -> Unit.t t
+ val partOf : 'a t -> Unit.t t
val getSub : 'a t -> 'a
val mapSub : ('a -> 'b) -> 'a t -> 'b t
end
Modified: mltonlib/trunk/org/mlton/vesak/tech/oo/framework/any.sml
===================================================================
--- mltonlib/trunk/org/mlton/vesak/tech/oo/framework/any.sml 2007-11-20 03:01:53 UTC (rev 6184)
+++ mltonlib/trunk/org/mlton/vesak/tech/oo/framework/any.sml 2007-11-20 07:37:06 UTC (rev 6185)
@@ -6,7 +6,7 @@
structure Any : ANY = struct
type 'a t = 'a
- fun part _ = ()
+ fun partOf _ = ()
val getSub = id
val mapSub = id
end
Modified: mltonlib/trunk/org/mlton/vesak/tech/oo/framework/sub.fun
===================================================================
--- mltonlib/trunk/org/mlton/vesak/tech/oo/framework/sub.fun 2007-11-20 03:01:53 UTC (rev 6184)
+++ mltonlib/trunk/org/mlton/vesak/tech/oo/framework/sub.fun 2007-11-20 07:37:06 UTC (rev 6185)
@@ -9,7 +9,7 @@
val its : (x -> 'r) -> 'a t -> 'r
end = struct
type 'a t = ('a, x) Product.t t
- fun part d = mapSub (Product.mapFst ignore) d
+ fun partOf d = mapSub (Product.mapFst ignore) d
fun its f d = f (Product.snd (getSub d))
val getSub = fn d => Product.fst (getSub d)
val mapSub = fn f => mapSub (Product.mapFst f)
Modified: mltonlib/trunk/org/mlton/vesak/tech/oo/imperative-shapes/README
===================================================================
--- mltonlib/trunk/org/mlton/vesak/tech/oo/imperative-shapes/README 2007-11-20 03:01:53 UTC (rev 6184)
+++ mltonlib/trunk/org/mlton/vesak/tech/oo/imperative-shapes/README 2007-11-20 07:37:06 UTC (rev 6185)
@@ -47,7 +47,7 @@
No implementation inheritance is used in the example.
- The "part" function specified in the ANY signature is for coercing an
+ The "partOf" function specified in the ANY signature is for coercing an
object to one of its supertypes. I would have preferred to call it
"from", so a call could be read naturally as in
Modified: mltonlib/trunk/org/mlton/vesak/tech/oo/imperative-shapes/main.sml
===================================================================
--- mltonlib/trunk/org/mlton/vesak/tech/oo/imperative-shapes/main.sml 2007-11-20 03:01:53 UTC (rev 6184)
+++ mltonlib/trunk/org/mlton/vesak/tech/oo/imperative-shapes/main.sml 2007-11-20 07:37:06 UTC (rev 6185)
@@ -11,8 +11,8 @@
; Shape.draw s)
(* Create some shapes: *)
-val scribble = [Shape.part (Rectangle.new {x=10, y=20, w=5, h=6}),
- Shape.part (Circle.new {x=15, y=25, r=8})]
+val scribble = [Shape.partOf (Rectangle.new {x=10, y=20, w=5, h=6}),
+ Shape.partOf (Circle.new {x=15, y=25, r=8})]
(* Handle shapes polymorphically: *)
val () = app drawAndMove scribble
More information about the MLton-commit
mailing list