literals vocab. you can interpolate CONSTANT-WORD values into a literal sequence with { $ CONSTANT-WORD } .
							parent
							
								
									02e961ac77
								
							
						
					
					
						commit
						4307234550
					
				| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					USING: kernel literals tools.test ;
 | 
				
			||||||
 | 
					IN: literals.tests
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<<
 | 
				
			||||||
 | 
					: five 5 ;
 | 
				
			||||||
 | 
					: seven-eleven 7 11 ;
 | 
				
			||||||
 | 
					: six-six-six 6 6 6 ;
 | 
				
			||||||
 | 
					>>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[ { 5 } ] [ { $ five } ] unit-test
 | 
				
			||||||
 | 
					[ { 7 11 } ] [ { $ seven-eleven } ] unit-test
 | 
				
			||||||
 | 
					[ { 6 6 6 } ] [ { $ six-six-six } ] unit-test
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,4 @@
 | 
				
			||||||
 | 
					USING: continuations kernel parser words ;
 | 
				
			||||||
 | 
					IN: literals
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					: $ scan-word [ execute ] curry with-datastack ; parsing
 | 
				
			||||||
		Loading…
	
		Reference in New Issue