{"action":"created","issue":{"url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/192","labels_url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/192/comments","events_url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/192/events","html_url":"https://github.com/ChaiScript/ChaiScript/issues/192","id":94496424,"number":192,"title":"Integer constants for (u)int8_t and (u)int16_t","user":{"login":"0xc0dec","id":2638851,"avatar_url":"https://avatars.githubusercontent.com/u/2638851?v=3","gravatar_id":"","url":"https://api.github.com/users/0xc0dec","html_url":"https://github.com/0xc0dec","followers_url":"https://api.github.com/users/0xc0dec/followers","following_url":"https://api.github.com/users/0xc0dec/following{/other_user}","gists_url":"https://api.github.com/users/0xc0dec/gists{/gist_id}","starred_url":"https://api.github.com/users/0xc0dec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xc0dec/subscriptions","organizations_url":"https://api.github.com/users/0xc0dec/orgs","repos_url":"https://api.github.com/users/0xc0dec/repos","events_url":"https://api.github.com/users/0xc0dec/events{/privacy}","received_events_url":"https://api.github.com/users/0xc0dec/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-11T18:16:33Z","updated_at":"2015-07-12T00:38:05Z","closed_at":"2015-07-12T00:36:38Z","body":"Currently the following code fails to compile:\r\n```\r\nvar a = U16Array();\r\na.push_back(1u);\r\n```\r\nwith an error\r\n```\r\nError: \"Error with function dispatch for function 'push_back'\" With parameters: (U16Array).(const uint32_t) during evaluation at (...)\r\n\r\n  12 overloads available:\r\n      (string).(char)\r\n      (ByteArray).(const uint8_t)\r\n      (U16Array).(const uint16_t)\r\n      (S16Array).(const int16_t)\r\n      (U32Array).(const uint32_t)\r\n      (S32Array).(const int)\r\n      <output omitted>\r\n      (Object).(Object) : call_exists(push_back_ref, container, x)\r\n          Defined at (standard prelude 122, 3)\r\n```\r\nI have my array types defined as follows:\r\n```\r\nengine->add(bootstrap::standard_library::vector_type<std::vector<uint8_t>>(\"ByteArray\"));\r\nengine->add(bootstrap::standard_library::vector_type<std::vector<uint16_t>>(\"U16Array\"));\r\nengine->add(bootstrap::standard_library::vector_type<std::vector<int16_t>>(\"S16Array\"));\r\nengine->add(bootstrap::standard_library::vector_type<std::vector<uint32_t>>(\"U32Array\"));\r\nengine->add(bootstrap::standard_library::vector_type<std::vector<int32_t>>(\"S32Array\"));\r\n```\r\nI've checked out the source code in `chaiscript_parser.hpp` (`buildInt` function) and it seems like integer types with size <= 4 bytes are simply not supported and don't have special suffixes like \"u\", \"ul\", etc.. Having that support would be nice."},"comment":{"url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/comments/120674291","html_url":"https://github.com/ChaiScript/ChaiScript/issues/192#issuecomment-120674291","issue_url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/192","id":120674291,"user":{"login":"lefticus","id":234279,"avatar_url":"https://avatars.githubusercontent.com/u/234279?v=3","gravatar_id":"","url":"https://api.github.com/users/lefticus","html_url":"https://github.com/lefticus","followers_url":"https://api.github.com/users/lefticus/followers","following_url":"https://api.github.com/users/lefticus/following{/other_user}","gists_url":"https://api.github.com/users/lefticus/gists{/gist_id}","starred_url":"https://api.github.com/users/lefticus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lefticus/subscriptions","organizations_url":"https://api.github.com/users/lefticus/orgs","repos_url":"https://api.github.com/users/lefticus/repos","events_url":"https://api.github.com/users/lefticus/events{/privacy}","received_events_url":"https://api.github.com/users/lefticus/received_events","type":"User","site_admin":false},"created_at":"2015-07-12T00:38:05Z","updated_at":"2015-07-12T00:38:05Z","body":"I actually fixed the bug in the last couple of commits here. I'd be reluctant to define 's' to be 2 bytes since 'short' can have different meanings on different platforms.\r\n\r\nBut anyhow, the issue is fixed on develop now."}}