grouping: change chunking to throw bounds-errors in nth.
instead of the more confusing slice-error.windows-high-dpi
							parent
							
								
									e749734b01
								
							
						
					
					
						commit
						551144b8a2
					
				| 
						 | 
				
			
			@ -2,6 +2,7 @@ USING: grouping tools.test kernel sequences arrays
 | 
			
		|||
math accessors ;
 | 
			
		||||
 | 
			
		||||
[ { 1 2 3 } 0 group ] must-fail
 | 
			
		||||
[ f 3 <groups> first ] [ bounds-error? ] must-fail-with
 | 
			
		||||
 | 
			
		||||
{ { "hell" "o wo" "rld" } } [ "hello world" 4 group ] unit-test
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,11 +14,9 @@ TUPLE: chunking { seq read-only } { n read-only } ;
 | 
			
		|||
 | 
			
		||||
INSTANCE: chunking sequence
 | 
			
		||||
 | 
			
		||||
M: chunking nth group@ <slice> ; inline
 | 
			
		||||
 | 
			
		||||
M: chunking nth-unsafe group@ <slice-unsafe> ; inline
 | 
			
		||||
 | 
			
		||||
M: chunking set-nth group@ <slice> 0 swap copy ;
 | 
			
		||||
M: chunking set-nth-unsafe group@ <slice-unsafe> 0 swap copy ;
 | 
			
		||||
 | 
			
		||||
M: chunking like drop { } like ; inline
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue