racket / racket/racket

racket/match rejects some quoted literals

Open
#3,972 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
5.2k
Forks
698
Avg merge
18h 34m
Merged PRs (30d)
5

Description

What version of Racket are you using?
8.2 CS

What program did you run?

#lang racket

(match-lambda
  ['#s(some-prefab a-symbol)
   #t])

What should have happened?
The program should compile and run successfully.

If you got an error message, please include it here.

match: non-literal in quote pattern in: #s(some-prefab a-symbol)

Please include any other relevant details
In contrast, this version (with quasiquote) works as expected:

#lang racket

(match-lambda
  [`#s(some-prefab a-symbol)
   #t])

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied #lang racket match-lambda example on Racket 8.2 CS, then trace the match handling for quoted prefab literals and compare it with the working quasiquote form. Done means the quoted #s(some-prefab a-symbol) pattern compiles and runs successfully without the non-literal error.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.