René's URL Explorer Experiment


Title: in-ns special form oddities · Issue #366 · pixie-lang/pixie · GitHub

Open Graph Title: in-ns special form oddities · Issue #366 · pixie-lang/pixie

X Title: in-ns special form oddities · Issue #366 · pixie-lang/pixie

Description: Imagine you are writing a test that operates on namespaces, but you don't want it to conflict with other tests that operate on namespaces, so you give the namespace a long name nested "within" your test namespace, like pixie.tests.test-s...

Open Graph Description: Imagine you are writing a test that operates on namespaces, but you don't want it to conflict with other tests that operate on namespaces, so you give the namespace a long name nested "within" your...

X Description: Imagine you are writing a test that operates on namespaces, but you don't want it to conflict with other tests that operate on namespaces, so you give the namespace a long name nested "wit...

Opengraph URL: https://github.com/pixie-lang/pixie/issues/366

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"in-ns special form oddities","articleBody":"1) Imagine you are writing a test that operates on namespaces, but you don't want it to conflict with other tests that operate on namespaces, so you give the namespace a long name nested \"within\" your test namespace, like pixie.tests.test-stdlib.foo. Then, because you want to refer to that namespace several times within the test, and you don't want to write it out each time, you assign it to a local, like this.\n\n```\n(let [test-ns :pixie.tests.test-stdlib.foo]\n  (in-ns test-ns)\n  (def y 3)\n  etc. etc.)\n```\n\nExcept the test fails. You expected that y would be created within pixie.tests.test-stdlib.foo, but instead it's created within namespace \"test-ns\". That's because in-ns is a special form at compile time, and it sets the compile-time namespace to \"test-ns\". Then it becomes a function at run time, and it sets the run-time namespace to pixie.tests.test-stdlib.foo, as you would see if you examined `*ns*`. I think that behavior is confusing.\n\n2) In the same vein, in-ns affects the environment even if never executed.\n\n```\nuser =\u003e (defn g [] (in-ns :pixie.tests.test-stdlib))\n\u003cVar user/g\u003e\npixie.tests.test-stdlib =\u003e \n```\n\nSo in this case, even though g was only compiled but not executed, it affected the current namespace. Similar stuff happens with `if` statements -- if you have an if statement in which one branch sets the namespace to :foo and another to :bar, all vars resolved after that will be resolved in the namespace of the second branch, etc..  The only thing that matters is the order in which the compiler encounters in-ns. \n\nI think having the compiler mutate the current namespace as it goes along is confusing, because it requires you to think about order of compilation. It requires non-local reasoning to figure out which var an unqualified symbol refers to -- not just looking at what's lexically-enclosing. This is unlike in clojure, where if you read through a file of function definitions all in one namespace, then you know how every symbol will be resolved simply by looking at its name (okay, with the exception of refers).\n\nWhat advantage does pixie gain by having in-ns be a special form that affects compilation state?\n","author":{"url":"https://github.com/joshua-g","@type":"Person","name":"joshua-g"},"datePublished":"2015-09-01T07:29:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/366/pixie/issues/366"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3d4c1029-af45-46e2-afd3-beea97659944
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBCFA:B6892:43CF7D:5A1B7A:6969D2CA
html-safe-nonce78042844c797a765918c02d0c9d0433d5987552ba9da329c50a836f52b188803
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0ZBOkI2ODkyOjQzQ0Y3RDo1QTFCN0E6Njk2OUQyQ0EiLCJ2aXNpdG9yX2lkIjoiMjIzMzEzMDA4MjI0NDM1MDY2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac194b4f5d743c73978e0565ca71572b5d29f9f1a0f18acfd78ecfc4057f419773
hovercard-subject-tagissue:104203923
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pixie-lang/pixie/366/issue_layout
twitter:imagehttps://opengraph.githubassets.com/24ba00da13a809beb4002440fa57f7b76436c5c6902ab1ddcd667107913a899a/pixie-lang/pixie/issues/366
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/24ba00da13a809beb4002440fa57f7b76436c5c6902ab1ddcd667107913a899a/pixie-lang/pixie/issues/366
og:image:altImagine you are writing a test that operates on namespaces, but you don't want it to conflict with other tests that operate on namespaces, so you give the namespace a long name nested "within" your...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejoshua-g
hostnamegithub.com
expected-hostnamegithub.com
Noneacedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056
turbo-cache-controlno-preview
go-importgithub.com/pixie-lang/pixie git https://github.com/pixie-lang/pixie.git
octolytics-dimension-user_id8930965
octolytics-dimension-user_loginpixie-lang
octolytics-dimension-repository_id24507006
octolytics-dimension-repository_nwopixie-lang/pixie
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24507006
octolytics-dimension-repository_network_root_nwopixie-lang/pixie
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release83c08c21cdda978090dc44364b71aa5bc6dcea79
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/pixie-lang/pixie/issues/366#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpixie-lang%2Fpixie%2Fissues%2F366
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpixie-lang%2Fpixie%2Fissues%2F366
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=pixie-lang%2Fpixie
Reloadhttps://github.com/pixie-lang/pixie/issues/366
Reloadhttps://github.com/pixie-lang/pixie/issues/366
Reloadhttps://github.com/pixie-lang/pixie/issues/366
pixie-lang https://github.com/pixie-lang
pixiehttps://github.com/pixie-lang/pixie
Notifications https://github.com/login?return_to=%2Fpixie-lang%2Fpixie
Fork 127 https://github.com/login?return_to=%2Fpixie-lang%2Fpixie
Star 2.4k https://github.com/login?return_to=%2Fpixie-lang%2Fpixie
Code https://github.com/pixie-lang/pixie
Issues 46 https://github.com/pixie-lang/pixie/issues
Pull requests 9 https://github.com/pixie-lang/pixie/pulls
Actions https://github.com/pixie-lang/pixie/actions
Projects 0 https://github.com/pixie-lang/pixie/projects
Wiki https://github.com/pixie-lang/pixie/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/pixie-lang/pixie/security
Please reload this pagehttps://github.com/pixie-lang/pixie/issues/366
Insights https://github.com/pixie-lang/pixie/pulse
Code https://github.com/pixie-lang/pixie
Issues https://github.com/pixie-lang/pixie/issues
Pull requests https://github.com/pixie-lang/pixie/pulls
Actions https://github.com/pixie-lang/pixie/actions
Projects https://github.com/pixie-lang/pixie/projects
Wiki https://github.com/pixie-lang/pixie/wiki
Security https://github.com/pixie-lang/pixie/security
Insights https://github.com/pixie-lang/pixie/pulse
New issuehttps://github.com/login?return_to=https://github.com/pixie-lang/pixie/issues/366
New issuehttps://github.com/login?return_to=https://github.com/pixie-lang/pixie/issues/366
in-ns special form odditieshttps://github.com/pixie-lang/pixie/issues/366#top
bughttps://github.com/pixie-lang/pixie/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/joshua-g
https://github.com/joshua-g
joshua-ghttps://github.com/joshua-g
on Sep 1, 2015https://github.com/pixie-lang/pixie/issues/366#issue-104203923
bughttps://github.com/pixie-lang/pixie/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.