(***********************************************************************) (* *) (* Applied Type System *) (* *) (* Hongwei Xi *) (* *) (***********************************************************************) (* ** ATS - Unleashing the Potential of Types! ** ** Copyright (C) 2002-2009 Hongwei Xi, Boston University ** ** All rights reserved ** ** ATS is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free ** Software Foundation; either version 2.1, or (at your option) any later ** version. ** ** ATS is distributed in the hope that it will be useful, but WITHOUT ANY ** WARRANTY; without even the implied warranty of MERCHANTABILITY or ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ** for more details. ** ** You should have received a copy of the GNU General Public License ** along with ATS; see the file COPYING. If not, write to the Free ** Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ** 02110-1301, USA. *) (* ****** ****** *) (* ** ** Contributed by Hongwei Xi (hwxi AT cs DOT bu DOT edu) ** Start Time: March, 2010 ** *) (* ****** ****** *) absviewt@ype work = @(ptr, ptr) // castfn work_decode (x: work): [vt:viewtype] (vt - void, vt) (* ****** ****** *) absviewtype workshop (l:addr) // boxed linear type (* ****** ****** *) fun workshop_make (): [l:addr] workshop l (* ****** ****** *) fun workshop_add_work {l:addr} {vt:viewtype} (ws: !workshop l, f: (vt) - void, env: vt): void // end of [workshop_add_work] fun workshop_add_work_cloptr {l:addr} (ws: !workshop l, f: () - void): void // workshop_add_work (app, f) // end of [workshop_add_work_cloptr] (* ****** ****** *) fun workshop_get_work {l:addr} (ws: !workshop l): work (* ****** ****** *) (* end of [parwork.sats] *)