Skip to content

Explicit empty value literal #420

@artwyman

Description

@artwyman

The concept of an empty/null value is helpful, and has come up in PODB prototyping. PODLang doesn't have a native represenation of this. The best available is Raw(0x0...) but that requires 64 zeroes. When #419 is fixed it could also be represented as [] or {} but standardizing that feels a bit too LISPish. Rust does use (), though.

I propose an explicit literal for this, similar to true and false. What it should be called and how it should be capitalized are open to debate.

I propose null as being most familiar to programmers. I wonder if it implies anything we don't want to (like the existence of pointers/references).
I could see using empty instead since that's what we use in Rust, but haven't seen that in other languages. Maybe we want it so as to explicitly suggest the fact that it's the same thing as {}?
I could see nil or undefined based on other languages, but those seem more rare.

Spelling could be NULL to imply constant, but if we were going to do that I feel like we should have TRUE and FALSE. I'd prefer to leave ALL_CAPS for user-defined constants.

Metadata

Metadata

Assignees

Labels

discussionTopic that requires discussionpodlangThe language to write custom predicates and pod requests

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions