| Thread overview | ||||||
|---|---|---|---|---|---|---|
|
March 30, 2016 Concatenative Programming Languages | ||||
|---|---|---|---|---|
| ||||
I just stumbled on this wikipedia article: https://en.wikipedia.org/wiki/Concatenative_programming_language Seems like D falls under that category? -S. | ||||
March 30, 2016 Re: Concatenative Programming Languages | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Shammah Chancellor | On Wednesday, 30 March 2016 at 20:53:02 UTC, Shammah Chancellor wrote:
> I just stumbled on this wikipedia article: https://en.wikipedia.org/wiki/Concatenative_programming_language
>
> Seems like D falls under that category?
>
> -S.
Not really. UFCS allows the syntax "x.foo.bar.baz", which is similar to a concatenative syntax, but the existence of "x" in the expression means it's not purely concatenative.
In a purely concatenative language, "foo bar baz" would produce a function that pipelines those three functions. "foo.bar.baz" in D would produce a compiler error.
| |||
March 30, 2016 Re: Concatenative Programming Languages | ||||
|---|---|---|---|---|
| ||||
Posted in reply to BLM768 | On Wednesday, 30 March 2016 at 22:14:11 UTC, BLM768 wrote:
> On Wednesday, 30 March 2016 at 20:53:02 UTC, Shammah Chancellor wrote:
>> I just stumbled on this wikipedia article: https://en.wikipedia.org/wiki/Concatenative_programming_language
>>
>> Seems like D falls under that category?
>>
>> -S.
>
> Not really. UFCS allows the syntax "x.foo.bar.baz", which is similar to a concatenative syntax, but the existence of "x" in the expression means it's not purely concatenative.
>
> In a purely concatenative language, "foo bar baz" would produce a function that pipelines those three functions. "foo.bar.baz" in D would produce a compiler error.
import std.functional : pipe;
alias allThree = pipe!(foo, bar, baz);
:)
| |||
March 31, 2016 Re: Concatenative Programming Languages | ||||
|---|---|---|---|---|
| ||||
Posted in reply to John Colvin | On Wednesday, 30 March 2016 at 22:20:02 UTC, John Colvin wrote:
> import std.functional : pipe;
> alias allThree = pipe!(foo, bar, baz);
>
> :)
Interesting, but I'd call that a concatenative sub-language at most. ;)
There's certainly some conceptual overlap between concatenative languages and D under certain conditions, but there's not much syntactic overlap.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply