Skip to content

Syntactic sugar for magic 0x5e1f constant #351

@robknight

Description

@robknight

In Podlang, we want to be able to write SELF, but have this be substituted for a magic constant at runtime.

The aim is to make it easy for frontend-aware clients to understand that the user's intent is to refer to the SELF PodId, which might not be clear from the use of a Raw() value.

Roughly speaking, given this POD Request:

REQUEST(
  Equal(?pod_id, Raw(0x5e1f))
  Equal(?pod_id["key"], 123)
)

If the response contains this:

Equal(0x123456, 0x123456)
Equal(0x123456["key"], 123)

Then the client is entitled to reject the response as the literal values do not match.

However, given:

REQUEST(
  Equal(?pod_id, SELF)
  Equal(?pod_id["key"], 123)
)

Then the client should accept the response as SELF is a special value which should match against any PodId.

This issue depends on #345 to define the magic constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    podlangThe language to write custom predicates and pod requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions