[plt-scheme] question about lift-strict in frtime

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Wed Jul 22 03:30:38 EDT 2009

Many thanks for the quick reply.

Gregory Cooper wrote:
> Hi Chongkai,
>
> Data constructors in FrTime do not implicitly propagate reactivity
> (they are not "lifted"), so, for example, (list 1 seconds) evaluates
> not to a behavior but to a list containing a behavior:
>
> (list 1 seconds) : List[Bhvr[Integer]]
>   

I see.

> Although structures with behaviors "nested" in them like this are
> important, it doesn't really make sense to apply "lift-strict" to
> them.  (They're not behaviors, and projecting their current values has
> no effect.)  Instead, for lifting you typically want a value where all
> the reactivity has been "raised" to the top level.  There are two ways
> to accomplish this:
>
> 1. Create data with lifted constructor applications, as you've done.
>   

That's not a good option. I just found it as the only way to make things 
work. The goal is to use quasiquote / unquote to construct those 
structures, thus keeping syntax overhead minimal.

> 2. Apply "raise-reactivity" to data before "lift-strict"ing a procedure over it.
>
>   

That's good because it keeps the syntax overhead low. The only glitch is 
that "raise-reactivity" is not provided by the frtime language. I found 
it in frtime/mzscheme-core with v4.2 but it is now called 
frtime/lang-core. Could I ask why it is not provided?

> However, for normal use, lifting is only really intended for
> procedures that consume simple data.  Thus I'd prefer another option
> altogether, which is to define any such structure-consuming procedures
> in FrTime instead of Scheme.  Then you shouldn't need to do any
> lifting at all...
>
>   

That's not a solution either. The procedure here is intended to work 
with "#lang scheme" first, and be able to work with frtime (be lifted) 
second.

> Greg
>
>   

Cheers,
Chongkai


Posted on the users mailing list.