mitranim / mitranim/jisp

Operator-functions need to fully mimic real functions

Open
#14 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
132
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Operator-functions are things like + or <:

(+ 2 3)

We need to be able to use them in all the same ways as normal functions, including this following.

Pass by name:

(array.filter <)

Property notation:

(+.apply `(1 2 3))

Spread:

(* ...`(3 4) `(5 6))

Supporting this requires the following components:

  • Impostor functions (trivial, partly implemented, see operators.jisp) to be embedded with .toString
  • Hoisting and embedding mechanism: already implemented, will need a few tweaks for this
  • Detect when the operator is referenced a non-standard way (one of the ways listed above), trigger replacement and embedding
  • Replacement: replace the operator glyph with the name of the impostor function
  • Treat impostor function names as service variables and guarantee that they don’t clash with user-defined names in any scope

Contributor guide

No contributing guide indexed for this repository

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 with operators.jisp and review the existing impostor-function implementation, then trace the already implemented hoisting and embedding mechanism. Map how non-standard operator references are detected and replaced, and verify completion with the pass-by-name, property-notation, spread, embedding, and name-collision requirements described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.