René's URL Explorer Experiment


Title: fix: array-literal pattern binders read 1-based Lua indices by Unisay · Pull Request #69 · purescript-lua/purescript-lua · GitHub

Open Graph Title: fix: array-literal pattern binders read 1-based Lua indices by Unisay · Pull Request #69 · purescript-lua/purescript-lua

X Title: fix: array-literal pattern binders read 1-based Lua indices by Unisay · Pull Request #69 · purescript-lua/purescript-lua

Description: Closes #49. Matching an array-literal pattern crashed at runtime. The binders were addressed with the IR's 0-based index (de Bruijn-style, like the source language) emitted straight into a 1-based Lua table, so the first element came back nil and [a, b] -> a + b blew up with attempt to perform arithmetic on a nil value. The fix shifts ArrayIndex by one in the Lua backend, so v[0]/v[1] becomes v[1]/v[2]. This matches the rest of the codegen, which is already 1-based: array literals build { [1] = ..., [2] = ... }, and the arrays FFI indexImpl reads xs[i + 1]. Test Adds an eval golden, Golden.ArrayPatternMatch, over the repro: firstTwo [10, 20] (matches [a, b]), the non-matching lengths [1,2,3] and [], and lastOfThree [7,8,9] (matches [_, _, c]). It runs the generated Lua and checks the output is 30 / -1 / -1 / 9. No golden previously exercised array-literal patterns, which is why this went unnoticed.

Open Graph Description: Closes #49. Matching an array-literal pattern crashed at runtime. The binders were addressed with the IR's 0-based index (de Bruijn-style, like the source language) emitted straight into a 1-ba...

X Description: Closes #49. Matching an array-literal pattern crashed at runtime. The binders were addressed with the IR's 0-based index (de Bruijn-style, like the source language) emitted straight into a ...

Opengraph URL: https://github.com/purescript-lua/purescript-lua/pull/69

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:63332fe3-4a96-b147-c525-5a303355bc06
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA5D2:1DB641:A8C003:DAF645:6B00E481
html-safe-nonce82207d1025cda2e214c733cdb4951f56374bed9359e2169e0cce53adac15ca94
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUQyOjFEQjY0MTpBOEMwMDM6REFGNjQ1OjZCMDBFNDgxIiwidmlzaXRvcl9pZCI6Ijg4NzkxODM5NDk5MTUwMjQ2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc0932fd6ee98d2adbff6b249898e63db49f0cebd4125a1ba595ff3b55528d1c5
hovercard-subject-tagpull_request:3862900064
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/purescript-lua/purescript-lua/pull/69/files
twitter:imagehttps://avatars.githubusercontent.com/u/1009751?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1009751?s=400&v=4
og:image:altCloses #49. Matching an array-literal pattern crashed at runtime. The binders were addressed with the IR's 0-based index (de Bruijn-style, like the source language) emitted straight into a 1-ba...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git
octolytics-dimension-user_id131581790
octolytics-dimension-user_loginpurescript-lua
octolytics-dimension-repository_id587200487
octolytics-dimension-repository_nwopurescript-lua/purescript-lua
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id587200487
octolytics-dimension-repository_network_root_nwopurescript-lua/purescript-lua
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release624179fb8b88d26ba5bba08894eb60a1c5a1d93d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/pull/69/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fpull%2F69%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fpull%2F69%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/69/files
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/69/files
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/69/files
purescript-luahttps://github.com/purescript-lua
purescript-luahttps://github.com/purescript-lua/purescript-lua
Codehttps://github.com/purescript-lua/purescript-lua
Issues48 (48)https://github.com/purescript-lua/purescript-lua/issues
Pull requestshttps://github.com/purescript-lua/purescript-lua/pulls
Discussionshttps://github.com/purescript-lua/purescript-lua/discussions
Actionshttps://github.com/purescript-lua/purescript-lua/actions
Projectshttps://github.com/purescript-lua/purescript-lua/projects
Security and qualityhttps://github.com/purescript-lua/purescript-lua/security
Insightshttps://github.com/purescript-lua/purescript-lua/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2Fnew%2Fchoose
Unisayhttps://github.com/Unisay
mainhttps://github.com/purescript-lua/purescript-lua/tree/main
issue-49/array-pattern-indexhttps://github.com/purescript-lua/purescript-lua/tree/issue-49/array-pattern-index
Conversation 1 https://github.com/purescript-lua/purescript-lua/pull/69
Commits 1 https://github.com/purescript-lua/purescript-lua/pull/69/commits
Checks 1 https://github.com/purescript-lua/purescript-lua/pull/69/checks
Files changed https://github.com/purescript-lua/purescript-lua/pull/69/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/69/files
fix: array-literal pattern binders read 1-based Lua indices https://github.com/purescript-lua/purescript-lua/pull/69/files#top
Show all changes 1 commit https://github.com/purescript-lua/purescript-lua/pull/69/files
c4cbc64 fix: array-literal pattern binders read 1-based Lua indices (#49) Unisay Jun 14, 2026 https://github.com/purescript-lua/purescript-lua/pull/69/commits/c4cbc64854dc491484be21e0648c95d7f20c2e34
Clear filters https://github.com/purescript-lua/purescript-lua/pull/69/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/69/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/69/files
Lua.hs https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
Test.purs https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-18635dcb3993006d4535f016f2a168b35ad6083841254750b9ad83648ac25f98
corefn.json https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-c467cdcd5f4b916f4fb13e229b5b235beb71c08a24cbbaf7610eb4a9f6af32ef
.gitignore https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-ea710c7263c014b036cd82739f3ff73ebd74822e8eff60135d97e55fd78142d0
golden.txt https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-1666ad7c3dde04c95d62eac102ded99aaba31005b43d490165e29dcd79ef940f
golden.ir https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-a50730a65be2dd43fb54fcc7256daba19c0f0d185fa91ae70fd74eb6dc88babb
golden.lua https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-f09de2d9591e7ed04c015cf5105c29cef2be557187d5d7b8ca203b70d4f11bfc
lib/Language/PureScript/Backend/Lua.hshttps://github.com/purescript-lua/purescript-lua/pull/69/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
View file https://github.com/purescript-lua/purescript-lua/blob/c4cbc64854dc491484be21e0648c95d7f20c2e34/lib/Language/PureScript/Backend/Lua.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/69/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
https://github.com/purescript-lua/purescript-lua/pull/69/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
test/ps/golden/Golden/ArrayPatternMatch/Test.purshttps://github.com/purescript-lua/purescript-lua/pull/69/files#diff-18635dcb3993006d4535f016f2a168b35ad6083841254750b9ad83648ac25f98
View file https://github.com/purescript-lua/purescript-lua/blob/c4cbc64854dc491484be21e0648c95d7f20c2e34/test/ps/golden/Golden/ArrayPatternMatch/Test.purs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/69/{{ revealButtonHref }}
test/ps/output/Golden.ArrayPatternMatch.Test/corefn.jsonhttps://github.com/purescript-lua/purescript-lua/pull/69/files#diff-c467cdcd5f4b916f4fb13e229b5b235beb71c08a24cbbaf7610eb4a9f6af32ef
View file https://github.com/purescript-lua/purescript-lua/blob/c4cbc64854dc491484be21e0648c95d7f20c2e34/test/ps/output/Golden.ArrayPatternMatch.Test/corefn.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/69/{{ revealButtonHref }}
test/ps/output/Golden.ArrayPatternMatch.Test/eval/.gitignorehttps://github.com/purescript-lua/purescript-lua/pull/69/files#diff-ea710c7263c014b036cd82739f3ff73ebd74822e8eff60135d97e55fd78142d0
View file https://github.com/purescript-lua/purescript-lua/blob/c4cbc64854dc491484be21e0648c95d7f20c2e34/test/ps/output/Golden.ArrayPatternMatch.Test/eval/.gitignore
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/69/{{ revealButtonHref }}
test/ps/output/Golden.ArrayPatternMatch.Test/eval/golden.txthttps://github.com/purescript-lua/purescript-lua/pull/69/files#diff-1666ad7c3dde04c95d62eac102ded99aaba31005b43d490165e29dcd79ef940f
View file https://github.com/purescript-lua/purescript-lua/blob/c4cbc64854dc491484be21e0648c95d7f20c2e34/test/ps/output/Golden.ArrayPatternMatch.Test/eval/golden.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/69/{{ revealButtonHref }}
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/69/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/69/files
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.