Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S sweet-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • sweet-js
  • sweet-core
  • Issues
  • #143
Closed
Open
Issue created Dec 04, 2013 by Administrator@rootContributor

strange behavior when overriding `function`

Created by: jlongster

I wrote a macro that overrides the function keyword:

let function = macro {
    rule { ($param (,) ...) $body } => {
        function ($param (,) ...) $body
    }

    rule { $id:ident ($param (,) ...) $body } => {
        function $id ($param (,) ...) $body
    }
}

macro foo {
    rule { $x } => {
        $x
    }
}

The function macro works fine, but it doesn't work if I define another macro. Evidently macro expands to something that contains this function definition:

function (stx context) {return syntaxCase (stx , context) {case {_ $x} = > {return syntax {$x}}}}

Why don't the arguments have a comma in between them? It makes it strangely unintuitive to write macros that override function :)

Assignee
Assign to
Time tracking