Arc Forumnew | comments | leaders | submitlogin
2 points by almkglor 6008 days ago | link | parent

> This is one of the many cases

fixed that for you ^_^ \/

For example, consider the minor problem of macros such as 'w/infile:

  (restartable
    (pr "Press enter to begin processing the file")
    (readline)
    (w/infile p "thefile.txt"
      (whilet l (readline p)
        (when (is l "foo\n")
              (prn "A \"foo\" was found in the file!")
              (prn "Please correct these errors first")
              (restart)))
      (prn "finished processing!")))
The point is that 'restart is really a continuation bound to the beginning of the 'restartable form. Obviously 'w/infile and related forms must trap continuations; the mzscheme implementation uses 'dynamic-wind, exposed as the 'protect function.

This is one of the many cases where having an explicit specification would have been nice, because this would have required some code digging. What, exactly, is 'protect intended to do?



2 points by stefano 6008 days ago | link

The problem is increased by the fact that the official arc implementation drains entire constructs (such as 'dynamic-wind) from the underlying scheme. How should we consider them when writing an alternative implementation? Are they intended to have the identical behavior of the corresponding scheme constructs? An official test suite would be really helpful and would solve most of the problems.

-----