PageRenderTime 55ms CodeModel.GetById 32ms RepoModel.GetById 0ms app.codeStats 1ms

/list.dylan

http://github.com/datafueled/python-dylan
Unknown | 32 lines | 29 code | 3 blank | 0 comment | 0 complexity | c7dd2a9cbb4b52d6a3614ced429346ed MD5 | raw file
  1. module: python-dylan
  2. synopsis: Python types support.
  3. author: Bruce Mitchener
  4. copyright: 2012, Data Fueled, LLC.
  5. define inline function py-list-check (value :: <py-object>)
  6. primitive-raw-as-boolean(
  7. %call-c-function("dylan_PyList_Check")
  8. (value :: <py-object>) => (check? :: <raw-c-signed-int>)
  9. (value)
  10. end
  11. )
  12. end;
  13. define inline function py-list-size (value :: <py-object>)
  14. //---*** Check for error!
  15. raw-as-integer(
  16. %call-c-function("PyList_Size")
  17. (value :: <py-object>) => (result :: <raw-c-signed-int>)
  18. (value)
  19. end
  20. )
  21. end;
  22. define inline function py-list-get-item (value :: <py-object>, index :: <integer>)
  23. //---*** Check for error!
  24. %call-c-function("PyList_GetItem")
  25. (value :: <py-object>, index :: <raw-c-signed-int>)
  26. => (result :: <py-object>)
  27. (value, integer-as-raw(index))
  28. end
  29. end;