Skip to content

Conversation

@nikku
Copy link
Owner

@nikku nikku commented Oct 18, 2024

Which issue does this PR address?

This PR attempts to recognize the special context(entries) function, creating a context from a list of entries:

Closes #40


Some uses of context attached that are not recognized today, but would be on proper context extraction:

context([
  { key: "b+", value: { c-: 1} }
]).b+.c-
{
  entries: [
    {
      "key": "a + b",
      "value": 1
    },
    {
      "key": "b--",
      "value": 2
    }
  ],
  ctx: context(entries),
  value: ctx.a + b + ctx.b--
}
{
  dynamicEntry: {
    "key": "a + b",
    "value": {
      d-e: 1000
    }
  },
  entries: [
    dynamicEntry
  ],
  ctx: context(entries),
  value: ctx.a+b.d-e
}
{
  dynamicKey: "a + b",
  dynamicValue: {
    d-e: 1000
  },
  entries: [
    {
      "key": dynamicKey,
      "value": dynamicValue
    }
  ],
  ctx: context(entries),
  value: ctx.a + b.d-e
}

@nikku nikku added the backlog label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

context() built-in is not properly handled

1 participant