{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/comments/173213111","pull_request_review_id":102365048,"id":173213111,"diff_hunk":"@@ -203,3 +330,108 @@ encode(x::LCMType) = (stream = IOBuffer(false, true); encode(stream, x); flush(s\n \n decode!(x::LCMType, data::Vector{UInt8}) = decode!(x, BufferedInputStream(data))\n decode(data::Vector{UInt8}, ::Type{T}) where {T<:LCMType} = decode!(T(), data)\n+\n+# @lcmtypesetup macro and related functions\n+function make_fixed_dimensions_method(::Type{T}, ::Type{<:SVector{N, <:Any}}, field::Symbol, axisnum::Int) where {T<:LCMType, N}\n+    let lcmdim = LCMCore.LCMDimension(N)\n+        LCMCore.dimensions(::Type{T}, ::Val{field}, ::Val{axisnum}) = lcmdim\n+    end\n+end\n+\n+function make_fixed_dimensions_methods(::Type{T}, ::Type{F}, field::Symbol, axisnum::Int) where {T<:LCMType, V, F<:AbstractVector{V}}\n+    F <: SVector && make_fixed_dimensions_method(T, F, field, axisnum)\n+    V <: AbstractVector && return make_fixed_dimensions_methods(T, V, field, axisnum + 1)\n+    axisnum\n+end\n+\n+function make_dimensions_methods(::Type{T}) where T<:LCMType\n+    for field in fieldnames(T)\n+        F = fieldtype(T, field)\n+        numaxes = F <: AbstractVector ? make_fixed_dimensions_methods(T, F, field, 1) : 0\n+        fieldval = Val(field)\n+        let dimtuple = ntuple(i -> Base.invokelatest(LCMCore.dimensions, T, fieldval, Val(i)), numaxes)","path":"src/lcmtype.jl","position":317,"original_position":317,"commit_id":"20e7206662a2b8b1aa8e66738032a32e321b38c6","original_commit_id":"20e7206662a2b8b1aa8e66738032a32e321b38c6","user":{"login":"tkoolen","id":2585880,"avatar_url":"https://avatars0.githubusercontent.com/u/2585880?v=4","gravatar_id":"","url":"https://api.github.com/users/tkoolen","html_url":"https://github.com/tkoolen","followers_url":"https://api.github.com/users/tkoolen/followers","following_url":"https://api.github.com/users/tkoolen/following{/other_user}","gists_url":"https://api.github.com/users/tkoolen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkoolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkoolen/subscriptions","organizations_url":"https://api.github.com/users/tkoolen/orgs","repos_url":"https://api.github.com/users/tkoolen/repos","events_url":"https://api.github.com/users/tkoolen/events{/privacy}","received_events_url":"https://api.github.com/users/tkoolen/received_events","type":"User","site_admin":false},"body":"Yeah, that's exactly it. I'll add a comment.","created_at":"2018-03-08T16:31:21Z","updated_at":"2018-03-08T16:31:21Z","html_url":"https://github.com/JuliaRobotics/LCMCore.jl/pull/26#discussion_r173213111","pull_request_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/26","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/comments/173213111"},"html":{"href":"https://github.com/JuliaRobotics/LCMCore.jl/pull/26#discussion_r173213111"},"pull_request":{"href":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/26"}},"in_reply_to_id":173212148},"pull_request":{"url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/26","id":173336534,"html_url":"https://github.com/JuliaRobotics/LCMCore.jl/pull/26","diff_url":"https://github.com/JuliaRobotics/LCMCore.jl/pull/26.diff","patch_url":"https://github.com/JuliaRobotics/LCMCore.jl/pull/26.patch","issue_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/issues/26","number":26,"state":"open","locked":false,"title":"Make LCMType creation easier","user":{"login":"tkoolen","id":2585880,"avatar_url":"https://avatars0.githubusercontent.com/u/2585880?v=4","gravatar_id":"","url":"https://api.github.com/users/tkoolen","html_url":"https://github.com/tkoolen","followers_url":"https://api.github.com/users/tkoolen/followers","following_url":"https://api.github.com/users/tkoolen/following{/other_user}","gists_url":"https://api.github.com/users/tkoolen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkoolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkoolen/subscriptions","organizations_url":"https://api.github.com/users/tkoolen/orgs","repos_url":"https://api.github.com/users/tkoolen/repos","events_url":"https://api.github.com/users/tkoolen/events{/privacy}","received_events_url":"https://api.github.com/users/tkoolen/received_events","type":"User","site_admin":false},"body":"This is mostly work I did a while ago. It works fine, but the problem is that the fingerprint computation is not done at compile time (and allocates). That's where I got stuck the last time. Naively turning `fingerprint` into a generated function doesn't work, because we'd need be calling `dimensions` inside the generator, which needs to be extended by the user for each `LCMType`, leading to world age issues. If you have any brilliant ideas for how to fix this easily, let me know.\r\n\r\nBTW, something like the `dimensions` function could make `size_fields`, `check_valid`, and `resize!` unnecessary as well.","created_at":"2018-03-07T02:25:26Z","updated_at":"2018-03-08T16:31:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"568415c8eca30b1ead1c806efa8feb9774ff6350","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/26/commits","review_comments_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/26/comments","review_comment_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/issues/26/comments","statuses_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/statuses/20e7206662a2b8b1aa8e66738032a32e321b38c6","head":{"label":"tkoolen:base-hash","ref":"base-hash","sha":"20e7206662a2b8b1aa8e66738032a32e321b38c6","user":{"login":"tkoolen","id":2585880,"avatar_url":"https://avatars0.githubusercontent.com/u/2585880?v=4","gravatar_id":"","url":"https://api.github.com/users/tkoolen","html_url":"https://github.com/tkoolen","followers_url":"https://api.github.com/users/tkoolen/followers","following_url":"https://api.github.com/users/tkoolen/following{/other_user}","gists_url":"https://api.github.com/users/tkoolen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkoolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkoolen/subscriptions","organizations_url":"https://api.github.com/users/tkoolen/orgs","repos_url":"https://api.github.com/users/tkoolen/repos","events_url":"https://api.github.com/users/tkoolen/events{/privacy}","received_events_url":"https://api.github.com/users/tkoolen/received_events","type":"User","site_admin":false},"repo":{"id":94921855,"name":"LCMCore.jl","full_name":"tkoolen/LCMCore.jl","owner":{"login":"tkoolen","id":2585880,"avatar_url":"https://avatars0.githubusercontent.com/u/2585880?v=4","gravatar_id":"","url":"https://api.github.com/users/tkoolen","html_url":"https://github.com/tkoolen","followers_url":"https://api.github.com/users/tkoolen/followers","following_url":"https://api.github.com/users/tkoolen/following{/other_user}","gists_url":"https://api.github.com/users/tkoolen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkoolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkoolen/subscriptions","organizations_url":"https://api.github.com/users/tkoolen/orgs","repos_url":"https://api.github.com/users/tkoolen/repos","events_url":"https://api.github.com/users/tkoolen/events{/privacy}","received_events_url":"https://api.github.com/users/tkoolen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tkoolen/LCMCore.jl","description":"Low-level Julia bindings for the LCM communications library","fork":true,"url":"https://api.github.com/repos/tkoolen/LCMCore.jl","forks_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/forks","keys_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/teams","hooks_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/hooks","issue_events_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/issues/events{/number}","events_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/events","assignees_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/assignees{/user}","branches_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/branches{/branch}","tags_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/tags","blobs_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/languages","stargazers_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/stargazers","contributors_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/contributors","subscribers_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/subscribers","subscription_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/subscription","commits_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/contents/{+path}","compare_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/merges","archive_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/downloads","issues_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/issues{/number}","pulls_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/labels{/name}","releases_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/releases{/id}","deployments_url":"https://api.github.com/repos/tkoolen/LCMCore.jl/deployments","created_at":"2017-06-20T18:16:10Z","updated_at":"2017-06-20T18:16:12Z","pushed_at":"2018-03-08T05:59:52Z","git_url":"git://github.com/tkoolen/LCMCore.jl.git","ssh_url":"git@github.com:tkoolen/LCMCore.jl.git","clone_url":"https://github.com/tkoolen/LCMCore.jl.git","svn_url":"https://github.com/tkoolen/LCMCore.jl","homepage":"","size":102,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JuliaRobotics:master","ref":"master","sha":"b4a6f86574f4308c5a288e938b8962d0203ae890","user":{"login":"JuliaRobotics","id":36864694,"avatar_url":"https://avatars1.githubusercontent.com/u/36864694?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaRobotics","html_url":"https://github.com/JuliaRobotics","followers_url":"https://api.github.com/users/JuliaRobotics/followers","following_url":"https://api.github.com/users/JuliaRobotics/following{/other_user}","gists_url":"https://api.github.com/users/JuliaRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaRobotics/subscriptions","organizations_url":"https://api.github.com/users/JuliaRobotics/orgs","repos_url":"https://api.github.com/users/JuliaRobotics/repos","events_url":"https://api.github.com/users/JuliaRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaRobotics/received_events","type":"Organization","site_admin":false},"repo":{"id":79831635,"name":"LCMCore.jl","full_name":"JuliaRobotics/LCMCore.jl","owner":{"login":"JuliaRobotics","id":36864694,"avatar_url":"https://avatars1.githubusercontent.com/u/36864694?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaRobotics","html_url":"https://github.com/JuliaRobotics","followers_url":"https://api.github.com/users/JuliaRobotics/followers","following_url":"https://api.github.com/users/JuliaRobotics/following{/other_user}","gists_url":"https://api.github.com/users/JuliaRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaRobotics/subscriptions","organizations_url":"https://api.github.com/users/JuliaRobotics/orgs","repos_url":"https://api.github.com/users/JuliaRobotics/repos","events_url":"https://api.github.com/users/JuliaRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaRobotics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaRobotics/LCMCore.jl","description":"Low-level Julia bindings for the LCM communications library","fork":false,"url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl","forks_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/forks","keys_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/teams","hooks_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/events","assignees_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/tags","blobs_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/subscription","commits_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/merges","archive_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/downloads","issues_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/deployments","created_at":"2017-01-23T17:59:38Z","updated_at":"2018-03-06T16:55:23Z","pushed_at":"2018-03-08T05:59:53Z","git_url":"git://github.com/JuliaRobotics/LCMCore.jl.git","ssh_url":"git@github.com:JuliaRobotics/LCMCore.jl.git","clone_url":"https://github.com/JuliaRobotics/LCMCore.jl.git","svn_url":"https://github.com/JuliaRobotics/LCMCore.jl","homepage":"","size":76,"stargazers_count":6,"watchers_count":6,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":5,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/26"},"html":{"href":"https://github.com/JuliaRobotics/LCMCore.jl/pull/26"},"issue":{"href":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/issues/26"},"comments":{"href":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaRobotics/LCMCore.jl/statuses/20e7206662a2b8b1aa8e66738032a32e321b38c6"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"tkoolen"}}