Allow two words keywords

  111249
July 29, 2020 16:49 david.proweb@gmail.com (David Rodrigues)
Hello!

I do not know if there is some consensus about "why not use two words as a
single keyword" in programming language in general, but I really found a
few examples of it, as in SQL with "GROUP BY", for instance.

So I question if it could be used on PHP to expand the keywords repertoire
by mixing two words without causes BC.

I will use the Attribute syntax-war to exemplify.

I really prefer to create a new keyword "attr()" or "attribute()" to make
attributes possible. It basically uses the same function-like with
arguments to work. But it invariably will cause BC to old codes that use
attr or attribute names (eg. "function attr()").

But, if we create a new two-words keyword like "using attr()", maybe it
will not cause any BC, because "function using attr()" is impossible, but
"using attr(X) function attr()" will do.

I do not know if I am being high with peanuts, but maybe it could be
considered to this discussion and make possible new features on PHP without
creating strange symbols like @@ or #[] that will requires that new users
check the documentation about "what it mean", while is very hard to Google
symbols (so search will be "what mean double at in PHP" or "what mean
hashtag brackets").


Atenciosamente,
David Rodrigues
  111250
July 29, 2020 17:00 nikita.ppv@gmail.com (Nikita Popov)
On Wed, Jul 29, 2020 at 6:50 PM David Rodrigues proweb@gmail.com>
wrote:

> Hello! > > I do not know if there is some consensus about "why not use two words as a > single keyword" in programming language in general, but I really found a > few examples of it, as in SQL with "GROUP BY", for instance. > > So I question if it could be used on PHP to expand the keywords repertoire > by mixing two words without causes BC. > > I will use the Attribute syntax-war to exemplify. > > I really prefer to create a new keyword "attr()" or "attribute()" to make > attributes possible. It basically uses the same function-like with > arguments to work. But it invariably will cause BC to old codes that use > attr or attribute names (eg. "function attr()"). > > But, if we create a new two-words keyword like "using attr()", maybe it > will not cause any BC, because "function using attr()" is impossible, but > "using attr(X) function attr()" will do. > > I do not know if I am being high with peanuts, but maybe it could be > considered to this discussion and make possible new features on PHP without > creating strange symbols like @@ or #[] that will requires that new users > check the documentation about "what it mean", while is very hard to Google > symbols (so search will be "what mean double at in PHP" or "what mean > hashtag brackets"). > > > Atenciosamente, > David Rodrigues >
PHP does have a two word keyword: "yield from" Nikita
  111251
July 29, 2020 17:45 david.proweb@gmail.com (David Rodrigues)
Oh, you are right! "yield from" is not common for me currently, so I really
skipped it.

In this case, is there some problem to apply it to Attribute case? "using
attribute(Attribute())" or something like that?


Atenciosamente,
David Rodrigues


Em qua., 29 de jul. de 2020 às 14:01, Nikita Popov ppv@gmail.com>
escreveu:

> On Wed, Jul 29, 2020 at 6:50 PM David Rodrigues proweb@gmail.com> > wrote: > >> Hello! >> >> I do not know if there is some consensus about "why not use two words as a >> single keyword" in programming language in general, but I really found a >> few examples of it, as in SQL with "GROUP BY", for instance. >> >> So I question if it could be used on PHP to expand the keywords repertoire >> by mixing two words without causes BC. >> >> I will use the Attribute syntax-war to exemplify. >> >> I really prefer to create a new keyword "attr()" or "attribute()" to make >> attributes possible. It basically uses the same function-like with >> arguments to work. But it invariably will cause BC to old codes that use >> attr or attribute names (eg. "function attr()"). >> >> But, if we create a new two-words keyword like "using attr()", maybe it >> will not cause any BC, because "function using attr()" is impossible, but >> "using attr(X) function attr()" will do. >> >> I do not know if I am being high with peanuts, but maybe it could be >> considered to this discussion and make possible new features on PHP >> without >> creating strange symbols like @@ or #[] that will requires that new users >> check the documentation about "what it mean", while is very hard to Google >> symbols (so search will be "what mean double at in PHP" or "what mean >> hashtag brackets"). >> >> >> Atenciosamente, >> David Rodrigues >> > > PHP does have a two word keyword: "yield from" > > Nikita >
  111258
July 30, 2020 09:49 deleugyn@gmail.com (Deleu)
Such a nice syntax. Even better than @@ and @. I wish this could get more
attention/traction.

On Wed, Jul 29, 2020, 19:46 David Rodrigues proweb@gmail.com> wrote:

> Oh, you are right! "yield from" is not common for me currently, so I really > skipped it. > > In this case, is there some problem to apply it to Attribute case? "using > attribute(Attribute())" or something like that? > > > Atenciosamente, > David Rodrigues > > > Em qua., 29 de jul. de 2020 às 14:01, Nikita Popov ppv@gmail..com> > escreveu: > > > On Wed, Jul 29, 2020 at 6:50 PM David Rodrigues proweb@gmail.com> > > wrote: > > > >> Hello! > >> > >> I do not know if there is some consensus about "why not use two words > as a > >> single keyword" in programming language in general, but I really found a > >> few examples of it, as in SQL with "GROUP BY", for instance. > >> > >> So I question if it could be used on PHP to expand the keywords > repertoire > >> by mixing two words without causes BC. > >> > >> I will use the Attribute syntax-war to exemplify. > >> > >> I really prefer to create a new keyword "attr()" or "attribute()" to > make > >> attributes possible. It basically uses the same function-like with > >> arguments to work. But it invariably will cause BC to old codes that use > >> attr or attribute names (eg. "function attr()"). > >> > >> But, if we create a new two-words keyword like "using attr()", maybe it > >> will not cause any BC, because "function using attr()" is impossible, > but > >> "using attr(X) function attr()" will do. > >> > >> I do not know if I am being high with peanuts, but maybe it could be > >> considered to this discussion and make possible new features on PHP > >> without > >> creating strange symbols like @@ or #[] that will requires that new > users > >> check the documentation about "what it mean", while is very hard to > Google > >> symbols (so search will be "what mean double at in PHP" or "what mean > >> hashtag brackets"). > >> > >> > >> Atenciosamente, > >> David Rodrigues > >> > > > > PHP does have a two word keyword: "yield from" > > > > Nikita > > >
  111262
July 30, 2020 13:15 josh@joshbruce.dev (Josh Bruce)
Maybe add it to that thread??

https://externals.io/message/111218

Cheers,
Josh

> On Jul 30, 2020, at 4:50 AM, Deleu <deleugyn@gmail.com> wrote: > > Such a nice syntax. Even better than @@ and @. I wish this could get more > attention/traction. > >> On Wed, Jul 29, 2020, 19:46 David Rodrigues proweb@gmail.com> wrote: >> >> Oh, you are right! "yield from" is not common for me currently, so I really >> skipped it. >> >> In this case, is there some problem to apply it to Attribute case? "using >> attribute(Attribute())" or something like that? >> >> >> Atenciosamente, >> David Rodrigues >> >> >> Em qua., 29 de jul. de 2020 às 14:01, Nikita Popov ppv@gmail..com> >> escreveu: >> >>> On Wed, Jul 29, 2020 at 6:50 PM David Rodrigues proweb@gmail.com> >>> wrote: >>> >>>> Hello! >>>> >>>> I do not know if there is some consensus about "why not use two words >> as a >>>> single keyword" in programming language in general, but I really found a >>>> few examples of it, as in SQL with "GROUP BY", for instance. >>>> >>>> So I question if it could be used on PHP to expand the keywords >> repertoire >>>> by mixing two words without causes BC. >>>> >>>> I will use the Attribute syntax-war to exemplify. >>>> >>>> I really prefer to create a new keyword "attr()" or "attribute()" to >> make >>>> attributes possible. It basically uses the same function-like with >>>> arguments to work. But it invariably will cause BC to old codes that use >>>> attr or attribute names (eg. "function attr()"). >>>> >>>> But, if we create a new two-words keyword like "using attr()", maybe it >>>> will not cause any BC, because "function using attr()" is impossible, >> but >>>> "using attr(X) function attr()" will do. >>>> >>>> I do not know if I am being high with peanuts, but maybe it could be >>>> considered to this discussion and make possible new features on PHP >>>> without >>>> creating strange symbols like @@ or #[] that will requires that new >> users >>>> check the documentation about "what it mean", while is very hard to >> Google >>>> symbols (so search will be "what mean double at in PHP" or "what mean >>>> hashtag brackets"). >>>> >>>> >>>> Atenciosamente, >>>> David Rodrigues >>>> >>> >>> PHP does have a two word keyword: "yield from" >>> >>> Nikita >>> >>