Skip to content

Extensions to let/c to let it replace rename-contract #3

@rocketnia

Description

@rocketnia

We could probably report better blame information from let/c contracts. Here's a starting point, although we should really compute the string at compile time so we don't have to do it every time we add blame:

(blame-add-context b
  (format "the expansion of foo/c, namely\n        ~aof"
    (string-replace (with-output-to-string /fn /pretty-print expansion)
      "\n"
      "\n        ")))

We might want all the bound variables to be wrapped in contracts that add some "the contract bound to the let/c variable element/c, namely" context as well.

We should also give let/c a #:rename <name> option. In the <name> expression, the bound variables are bound to the names of the contracts they're bound to.

At that point we might even be able to make a define-contract form of some sort.

Hmm. Another source of consternation when writing these contract aliases is that we might need to pass various different keyword arguments to some combinators depending on obstinacy. The string generation might depend on those extra keyword arguments, too, so I guess some phase-1 expressions generating contract expressions might be the ideal approach here. But for the resistance of scope creep's sake, let's stop short of counting that as part of this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions