Skip to main content

Questions tagged [design-patterns]

2 votes
1 answer
334 views

Handling two different ways to write `else if`?

In Universities, students spend a lot of time correcting syntax errors. For purposes of a thought experiment, suppose that a new language was developed that supported multiple syntaxi. For a simple ...
Samuel Muldoon's user avatar
4 votes
4 answers
759 views

Architecture for overriding "trait" implementations many times in different contexts?

I just asked this question about Rust: Is it possible to create a default trait implementation in Rust, and then override that trait implementation somewhere else? My problem is, in my custom lang, I ...
Lance Pollard's user avatar
5 votes
2 answers
204 views

Is it necessary to provide singleton as language keywords?

Background The singleton pattern is a widely used design pattern in the OOP language. I'm considering adding a built-in singleton declaration to my language. In Scala and Kotlin, we can use ...
Aster's user avatar
  • 3,458