unison/unison-src/transcripts/reflog.output.md
Stew O'Connor e231f80211 Add a new Pattern.captureAs builtin
Adding a Pattern.captureAs which will act just like capture, but
additionally takes an `a` which will be used as a replacement for the
capture.

My motivation for adding it is that I want to match on escape
sequence, but actually capture the unescaped character instead.

For example:

```
Pattern.captureAs "\n" (Pattern.literal "\\n")
```
2023-05-08 16:31:59 -07:00

1.7 KiB

First we make two changes to the codebase, so that there's more than one line for the reflog command to display:

x = 1

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:
  
    ⍟ These new definitions are ok to `add`:
    
      x : Nat

.> add

  ⍟ I've added these definitions:
  
    x : Nat

y = 2

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:
  
    ⍟ These new definitions are ok to `add`:
    
      y : Nat

.> add

  ⍟ I've added these definitions:
  
    y : Nat

.> view y

  y : Nat
  y = 2

.> reflog

  Here is a log of the root namespace hashes, starting with the
  most recent, along with the command that got us there. Try:
  
    `fork 2 .old`             
    `fork #tl79d3bnqc .old`   to make an old namespace
                              accessible again,
                              
    `reset-root #tl79d3bnqc`  to reset the root namespace and
                              its history to that of the
                              specified namespace.
  
       When   Root Hash     Action
  1.   now    #b5rv4dsc45   add
  2.   now    #tl79d3bnqc   add
  3.   now    #99irpo9ns9   builtins.merge
  4.          #sg60bvjo91   history starts here
  
  Tip: Use `diff.namespace 1 7` to compare namespaces between
       two points in history.

If we reset-root to its previous value, y disappears.

.> reset-root 2

  Done.

.> view y

  ⚠️
  
  The following names were not found in the codebase. Check your spelling.
    y