3 ms·
Yes of course, certainly there are language constructs or features specific for some domain. That doesn't necessarily mean that such constructs can't be used in
by klibertp 14y ago
Yes of course, certainly there are language constructs or features specific for some domain. That doesn't necessarily mean that such constructs can't be used in other contexts or domains (sometimes they can, sometimes not) but they were introduced into a language with a specific domain in mind.
For example Erlang's `receive...after...end` and `!` are language constructs that are specific to the domain of message passing concurrency and they cannot be used for anything else. On the other hand Erlang's bit syntax is specific to the domain of writing binary network protocols but can be used for extracting data from binary files or constructing chunks of bytes for interoperability with C (structs).
There are many more such examples in various languages - despite being "general purpose" they frequently include features and constructs useful for some specific domain - it's a natural way the languages are created and evolve.