Demux.yqls 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. (
  2. #comment
  3. (let res_sink (DataSink 'result))
  4. (let config (DataSource 'config))
  5. (let varTuple (VariantType (TupleType (DataType 'String) (DataType 'Bool) (DataType 'Uint32))))
  6. (let varList (AsList
  7. (Variant (String 'a1) '0 varTuple)
  8. (Variant (Uint32 '3) '2 varTuple)
  9. (Variant (String 'a2) '0 varTuple)
  10. (Variant (Bool 'false) '1 varTuple)
  11. (Variant (Uint32 '1) '2 varTuple)
  12. (Variant (String 'a3) '0 varTuple)
  13. (Variant (Uint32 '2) '2 varTuple)
  14. (Variant (Bool 'true) '1 varTuple)
  15. (Variant (Uint32 '4) '2 varTuple)
  16. ))
  17. (let data (Demux varList))
  18. (let world (Write! world res_sink (Key) data '('('type))))
  19. (let varStruct (VariantType (StructType '('s (DataType 'String)) '('b (DataType 'Bool)) '('u (DataType 'Uint32)))))
  20. (let varList (AsList
  21. (Variant (String 'a1) 's varStruct)
  22. (Variant (Uint32 '3) 'u varStruct)
  23. (Variant (String 'a2) 's varStruct)
  24. (Variant (Bool 'false) 'b varStruct)
  25. (Variant (Uint32 '1) 'u varStruct)
  26. (Variant (String 'a3) 's varStruct)
  27. (Variant (Uint32 '2) 'u varStruct)
  28. (Variant (Bool 'true) 'b varStruct)
  29. (Variant (Uint32 '4) 'u varStruct)
  30. ))
  31. (let data (Demux varList))
  32. (let world (Write! world res_sink (Key) data '('('type))))
  33. (let world (Commit! world res_sink))
  34. (return world)
  35. )