Skip to content

space.transform doesn't correctly handle parsed_packer / parsed_unpacker #768

@distractedlambda

Description

@distractedlambda

With a definition like this:

space.transform myspace:
  space_path myspace
  meta_namespace myspace_meta:
    parse_syntax_class Parsed
    parsed_packer pack
    parsed_unpacker unpack

there are no syntax errors, but pack and unpack are not actually defined within myspace_meta; the documentation seems to indicate that these clauses should be supported for space.transform.

With that said, I'm not sure it actually makes sense for space.transform to support these clauses in the same way that space.enforest does (w.r.t. enabling recursive parsing)? The sorts of spaces that use only prefix macros, tend to be ones where expansion may give multiple output groups for a single input group, and where some of those output groups might not be destined for further parsing in the same space. Even so, it might still be useful to be able to define pack/unpack procedures for such a space, to encapsulate "primitive" forms (my workarounds to date have involved specially recognizing primitives with bound_as).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions