feat(tvix/eval): non-recursive implementation of nix_eq()
This passes all the function/thunk-pointer-equality tests in cl/7369. Change-Id: Ib47535ba2fc77a4f1c2cc2fd23d3a879e21d8b4c Signed-off-by: Adam Joseph <adam@westernsemico.com> Reviewed-on: https://cl.tvl.fyi/c/depot/+/7358 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
		
							parent
							
								
									ed9aa0c32a
								
							
						
					
					
						commit
						dad8a7cbff
					
				
					 4 changed files with 133 additions and 34 deletions
				
			
		| 
						 | 
				
			
			@ -250,7 +250,7 @@ mod pure_builtins {
 | 
			
		|||
    #[builtin("elem")]
 | 
			
		||||
    fn builtin_elem(vm: &mut VM, x: Value, xs: Value) -> Result<Value, ErrorKind> {
 | 
			
		||||
        for val in xs.to_list()? {
 | 
			
		||||
            if val.nix_eq(&x, vm)? {
 | 
			
		||||
            if vm.nix_eq(val, x.clone(), true)? {
 | 
			
		||||
                return Ok(true.into());
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue