feat(tvix/eval): Implement builtins.seq
Since we already have infra for forcing arguments to builtins, this ends up being almost *too* simple - we just return the second argument! Change-Id: I070d3d0b551c4dcdac095f67b31e22e0de90cbd7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6999 Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
This commit is contained in:
		
							parent
							
								
									6e30fbbf7b
								
							
						
					
					
						commit
						89dbcbbb3d
					
				
					 4 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -490,6 +490,11 @@ fn pure_builtins() -> Vec<Builtin> {
 | 
			
		|||
                Ok(Value::attrs(NixAttrs::from_map(res)))
 | 
			
		||||
            },
 | 
			
		||||
        ),
 | 
			
		||||
        Builtin::new("seq", &[true, true], |mut args: Vec<Value>, _: &mut VM| {
 | 
			
		||||
            // The builtin calling infra has already forced both args for us, so we just return the
 | 
			
		||||
            // second and ignore the first
 | 
			
		||||
            Ok(args.pop().unwrap())
 | 
			
		||||
        }),
 | 
			
		||||
        Builtin::new("splitVersion", &[true], |args: Vec<Value>, _: &mut VM| {
 | 
			
		||||
            let s = args[0].to_str()?;
 | 
			
		||||
            let s = VersionPartsIter::new(s.as_str());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue