On this page:
4.1 Clarification
clarify/  multi
local-asset-url?
file-url?
file-readable?
build-complete-simple-path
4.2 Asset Advancement and Regression
chain
block
rebuild
7.4

4 Policy authoring utilities

 (require unlike-assets/policy) package: unlike-assets

This module provides practical tools when working with unlike-compiler%.

4.1 Clarification

procedure

(clarify/multi compiler unclear-names)  (listof clear/c)

  compiler : (instanceof/c (subclass?/c unlike-compiler%))
  unclear-names : (listof unclear/c)
Maps unclear names to clear names using a compiler.

procedure

(local-asset-url? str)  boolean?

  str : string?
Returns #t if str is a URL that meets ALL of the below criteria:

Use case: Distinguishing when URLs refer to a local filesystem.

procedure

(file-url? url-inst)  boolean?

  url-inst : url?
Returns #t if url-inst has no scheme or a "file" scheme.

procedure

(file-readable? path)  boolean?

  path : path?
Returns #t if path refers to an existing file and read permissions are set for the process.

procedure

(build-complete-simple-path path    
  [relative-to])  complete-path?
  path : (or/c string? path?)
  relative-to : (or/c path? boolean?) = #f
If relative-to is a path, and path is not complete, returns (simplify-path (build-path relative-to path)). Otherwise returns (simplify-path path).

4.2 Asset Advancement and Regression

procedure

(chain proc args ...)  procedure?

  proc : procedure?
  args : any/c
Returns an advance/c procedure that returns the value of (apply proc args).

Use to transmit dynamically bound values across advance/c functions or to define simpler procedures that do not have to comply with the domain requirements of advance/c.

(define (step2 extra) extra)
 
(define/contract (step1 clear compiler) advance/c
  (chain step2 'data))

value

block : ripple/c

A ripple procedure that unconditionally prevents change from propogating.

value

rebuild : ripple/c

A ripple procedure that unconditionally forces an asset to rebuild.