//
// Course: BU CAS CS 520, Fall 2010
// Instructor: Hongwei Xi (hwxi AT cs DOT bu DOT edu)
// Lecture on Thursday, Nov 4, 2010
//

(* ****** ****** *)

dataview
slseg_v (
  a:t@ype+, int, addr, addr
) =
  | {l:addr} slseg_v_nil (a, 0, l, l) of ()
  | {l1,l2:addr | l1 > null} {l_nxt:addr} {n:nat}
    slseg_v_cons (a, n+1, l1, l2) of 
      ((a, ptr (l_nxt)) @ l1, slseg_v (a, n, l_nxt, l2))
// end of [slseg_v]

(* ****** ****** *)

viewdef sllst_v (a:t@ype, n:int, l:addr) = slseg_v (a, n, l, null)

(* ****** ****** *)

(* end of [slseg.dats] *)