unison icon indicating copy to clipboard operation
unison copied to clipboard

don't reset numbering between every command?

Open aryairani opened this issue 5 years ago • 7 comments

I keep running into this sort of situation:

.temp> ls

  1. base/  (470 definitions)
  2. base_/ (470 definitions)

Okay. I don't want these, and I want to delete them.

I can't delete.namespace 1-2, so I will issue it as two separate commands.

.temp> delete.namespace 1

  Removed definitions:
  
    1.   builtin type Boolean
    2.   builtin type Bytes
    3.   builtin type Char
    ...

.temp> delete.namespace 2

  extra characters after temp.base.Bytes: "##Bytes"

.temp>

I meant the thing that was 2 when I decided I was going to delete both namespaces!

We could have a command to reset the numbering if it gets too big for people? Although that system seems bad too.

aryairani avatar Mar 17 '20 03:03 aryairani

@aryairani what about 1a, 1b, 1c, etc. Each numbered output gets a suffix (which user is informed of at the end of any pretty printed numbered output). Latest command numbering can be accessed like now, with no suffix, but you can also look back to find the suffix of a previous command, and say view 4m or whatever.

This is shorter to type, avoids difficulty of when to reset / wrap the numbers (don't want to do it mid-command), and gives easy access to last 26 numbered outputs.

pchiusano avatar Mar 19 '20 03:03 pchiusano

@pchiusano Hmm.

wrt

Latest command numbering can be accessed like now, with no suffix, but you can also look back to find the suffix of a previous command, and say view 4m or whatever.

I feel this wouldn't solve my initial problem — my brain enqueues "delete 1", "delete 2", but due to side effects, "2" is changed.

Also, it's a little crazy.

But it might work? Ranges would have to be like 1-6k 😬

aryairani avatar Mar 19 '20 13:03 aryairani

You could also just show 1b, 2b etc in the original output. Ranges do look a little funny with this approach, though 1-10 range could still refer to latest output.

pchiusano avatar Mar 19 '20 17:03 pchiusano

@pchiusano @runarorama WDYT about numbered prefix?

.temp> ls

  1.1. base/  (470 definitions)
  1.2. base_/ (470 definitions)

Okay. I don't want these, and I want to delete them.

I can't delete.namespace 1-2, so I will issue it as two separate commands.

.temp> delete.namespace 1

  Removed definitions:
  
    2.1.   builtin type Boolean
    2.2.   builtin type Bytes
    2.3.   builtin type Char
    ...

.temp.> view 2.1-3

 ... doesn't bomb ...

.temp> delete.namespace 1.2

But also I think we should just switch to a richer structure than strings.

aryairani avatar May 03 '20 14:05 aryairani

1a 1b etc?

I was also thinking just reseting every 999 entries might work fine.

pchiusano avatar May 03 '20 15:05 pchiusano

Sometimes numbering resets even within a single command:

.tmp> delete.term 1

  ⚠️
  
  I couldn't delete
  
    1. tmp.hello : .base.Text ->{.base.IO} ()
    
  
  because it's still being used by these definitions:
  
    1. tmp.runHello : '{.base.IO} ()

aryairani avatar Jun 20 '21 16:06 aryairani

Sometimes numbering resets even within a single command:

This particular case doesn‘t seem to exist any more, but if there are others like it, it’s simply a bug, right? We should probably avoid numbering anything that doesn’t get put into numberedArgs.

sellout avatar Jun 26 '24 22:06 sellout