-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update write_accessors in generate.py for bool #56
Conversation
確かに.このパターンは時々あって, std_msgs::Bool は時々使うと思うけど,今までどうしていたのかな? @furushchev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for late response
If I understand correctly, this problem is related to euslisp/EusLisp#240?
I just created a pull request for addressing this (euslisp/EusLisp#254) , so you can now choose the solution from both side.
(Both are good to me though taking argument with &rest
allows multiple arguments which is actially invalid)
If my pull request is merged, another solution for this problem should look like:
(:data
(&optional (__data nil __data_supplied_p))
(if __data_supplied_p (setq _data __data)) _data)
趣味の違いだと思いますが,僕はいままで,bool型みたいなプリミティブに近い型は送らない使い方をしていたので,問題に思っていませんでした.(気づいてませんでした) |
お返事ありがとうございます。
を使用するバージョンを作成しました。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Naoki-Hiraoka ありがとうございます!git rebase
してコミットメッセージを1つのわかりやすいものにしていただけると嬉しいです.
supplied_p
ebef385
to
8a91945
Compare
|
既出でしたら申し訳ありません。
generate.pyによって作成されるeuslispのコードでは、引数にnilをいれるとデータが変化しない仕様になっており、上記のようにデータをnilに変更することができません。generate.pyによって下記のようなコードが生成されるためです。
引数にnilを入れてもデータが変化しない仕様にはメリットもありますが、データの型がboolだった場合に限っては、一度trueにすると二度とfalseに戻せなくなってしまうというデメリットが大きいと感じます。データの型がboolだった場合に限り下記のようなコードを生成するようにしたいと思いwrite_accessors関数を書き換えてみたのですが、いかがでしょうか。