Title: Should a `nil` `:ns-prefix` be allowed in `codegen/write-namespace!`? · Issue #211 · clj-python/libpython-clj · GitHub
Open Graph Title: Should a `nil` `:ns-prefix` be allowed in `codegen/write-namespace!`? · Issue #211 · clj-python/libpython-clj
X Title: Should a `nil` `:ns-prefix` be allowed in `codegen/write-namespace!`? · Issue #211 · clj-python/libpython-clj
Description: Hi, I was using codegen/write-namespace! and found that using a nil :ns-prefix results in a generated namespace that starts with a .. This makes the generated namespace an illegal Java class name. I was wondering if a nil :ns-prefix woul...
Open Graph Description: Hi, I was using codegen/write-namespace! and found that using a nil :ns-prefix results in a generated namespace that starts with a .. This makes the generated namespace an illegal Java class name. ...
X Description: Hi, I was using codegen/write-namespace! and found that using a nil :ns-prefix results in a generated namespace that starts with a .. This makes the generated namespace an illegal Java class name. ...
Opengraph URL: https://github.com/clj-python/libpython-clj/issues/211
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Should a `nil` `:ns-prefix` be allowed in `codegen/write-namespace!`?","articleBody":"Hi,\r\n\r\nI was using `codegen/write-namespace!` and found that using a `nil` `:ns-prefix` results in a generated namespace that starts with a `.`. This makes the generated namespace an illegal Java class name.\r\n\r\nI was wondering if a `nil` `:ns-prefix` would be an allowed? This would allow the same namespace patterns between Clojure and Python, making interop seem more \"seamless\".\r\n\r\nA possible implementation would be the `ns-symbol` binding in `codegen/write-namespace!` ignoring a `nil` or blank `:ns-prefix`, e.g.,\r\n\r\n```diff\r\n(defn write-namespace! \r\n ...\r\n (let [...\r\n- ns-symbol (or ns-symbol (symbol (str ns-prefix \".\" py-mod-or-cls)))]\r\n+ ns-symbol (or ns-symbol (symbol (str (when-not (s/blank? ns-prefix) (str ns-prefix \".\"))\r\n+ py-mod-or-cls)))]\r\n\r\n``` \r\n\r\nI see that we can already define `:ns-symbol` directly to achieve a `nil` `:ns-prefix`, so this may already be allowed behaviour.\r\n\r\nFor your kind consideration. \r\n\r\nMany thanks for this excellent library!","author":{"url":"https://github.com/harishmohanadas","@type":"Person","name":"harishmohanadas"},"datePublished":"2022-08-02T06:18:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/211/libpython-clj/issues/211"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bb9e3de7-f005-63ce-5285-91e902be8633 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ABA:EEF27:B0FBBB:F2B94D:6A63B94F |
| html-safe-nonce | b18b85081a1b9001ed56f2530b6c239509267a2bbe363b53508956dddcc1011c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUJBOkVFRjI3OkIwRkJCQjpGMkI5NEQ6NkE2M0I5NEYiLCJ2aXNpdG9yX2lkIjoiNDY3MDQxNjIyNzY1MTUzMzEzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d9382034dc7df6d7c8b7f53d19fa96089abc8665830ee8abf6c6ff9b8cda8527 |
| hovercard-subject-tag | issue:1325342052 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/clj-python/libpython-clj/211/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1ae436a213e874a04eb29e6a49ab65236015814dcea0bc8dcdb998b2fd64b53f/clj-python/libpython-clj/issues/211 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1ae436a213e874a04eb29e6a49ab65236015814dcea0bc8dcdb998b2fd64b53f/clj-python/libpython-clj/issues/211 |
| og:image:alt | Hi, I was using codegen/write-namespace! and found that using a nil :ns-prefix results in a generated namespace that starts with a .. This makes the generated namespace an illegal Java class name. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | harishmohanadas |
| hostname | github.com |
| expected-hostname | github.com |
| None | b1a203abf5b8fb9010b42a32ce0f19fb6e11e656f254d0d3dcdba4b65a6961a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/clj-python/libpython-clj git https://github.com/clj-python/libpython-clj.git |
| octolytics-dimension-user_id | 60827878 |
| octolytics-dimension-user_login | clj-python |
| octolytics-dimension-repository_id | 187095617 |
| octolytics-dimension-repository_nwo | clj-python/libpython-clj |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 187095617 |
| octolytics-dimension-repository_network_root_nwo | clj-python/libpython-clj |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3ae9132c55b60e2a8f9553322217eb369dd24575 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width