BitCore.yqls 1.8 KB

1234567891011121314151617181920212223242526272829
  1. (
  2. (let config (DataSource 'config))
  3. (import core_module '"/lib/yql/core.yqls")
  4. (let res_sink (DataSink 'result))
  5. (let test (lambda '(world data) (block '(
  6. (let world (Write! world res_sink (Key) data '('('type))))
  7. (return world)
  8. ))))
  9. (let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '0))))
  10. (let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '10))))
  11. (let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '11))))
  12. (let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '23))))
  13. (let world (Apply test world (Apply (bind core_module 'TestBit) (Just (String '"\x05\x04")) (Uint64 '0))))
  14. (let world (Apply test world (Apply (bind core_module 'TestBit) (Just (Utf8 '"\x05\x04")) (Uint64 '0))))
  15. (let world (Apply test world (Apply (bind core_module 'TestBit) (Uint8 '5) (Uint8 '0))))
  16. (let world (Apply test world (Apply (bind core_module 'TestBit) (Uint32 '5) (Uint8 '2))))
  17. (let world (Apply test world (Apply (bind core_module 'TestBit) (Uint64 '5) (Uint8 '1))))
  18. (let world (Apply test world (Apply (bind core_module 'TestBit) (Just (Uint8 '5)) (Uint8 '0))))
  19. (let world (Apply test world (Apply (bind core_module 'SetBit) (Uint32 '5) (Uint8 '1))))
  20. (let world (Apply test world (Apply (bind core_module 'SetBit) (Just (Uint32 '5)) (Uint8 '1))))
  21. (let world (Apply test world (Apply (bind core_module 'ClearBit) (Uint32 '5) (Uint8 '0))))
  22. (let world (Apply test world (Apply (bind core_module 'ClearBit) (Just (Uint32 '5)) (Uint8 '0))))
  23. (let world (Apply test world (Apply (bind core_module 'FlipBit) (Uint32 '5) (Uint8 '0))))
  24. (let world (Apply test world (Apply (bind core_module 'FlipBit) (Just (Uint32 '5)) (Uint8 '0))))
  25. (let world (Commit! world res_sink))
  26. (return world)
  27. )