-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate Object.:
; add :, ¦ and ⫶
#89
Conversation
Looks good. In addition, I suggest removing the Another thing may be to make |
Okay, I assumed you wouldn't be interested in a backwards in-compatible change like that, but I'm all for it!
Yeah, I tried adding it to the parser and deparser but I couldn't get it working. Maybe I'll try again... |
Thinking a bit more about this, I'm considering removing the |
Moving Personally I get a lot of use out of Plus, there is one big benefit to using Do you intend to keep the |
6237627
to
4454206
Compare
Ok. Let's save the breaking change for Sidef v4.00 then, when lots of code is going break then anyway, as I intend to fix #79 before v4.00 comes out, which requires reimplementing the classes in a better way. In general, when something is objectively bad and needs to go away or get reimplemented, breaking the backwards-compatibility is acceptable. The reasons why I think the Pair class needs to go away (in favor of the Array class), are:
Maybe adding the
Yes, this is useful sometimes. |
777917b
to
312f10c
Compare
Ok, Also, even though :U+FF1A looks nice it can be long to type, so the ¦ U+A6 is another name for it. |
312f10c
to
1619e5d
Compare
Object.:
; add :, ¦ and ⫶
Object.:
; add :, ¦ and ⫶ Object.:
; add :, ¦ and ⫶
1619e5d
to
652577d
Compare
Object.:
; add :, ¦ and ⫶ Object.:
; add :, ¦ and ⫶
Deprecate the `:` (colon) method from Object. Starting with Sidef v4.0 it will be removed from Object entirely, and only be used to create Complex and standard named param- eter syntax for Blocks (when its LHS is a bareword). The utility of `:` has been bisected into the `:` (fat/fullwidth colon; more easily written `¦`) and `⫶` (triple colon). `:` as a Pair constructor remains for now, but code using it should be updated to use the new methods. - Object.:, the fullwidth colon U+FF1A: force creation of a Pair from self and the first argument. - Object.¦, the broken bar U+A6: alias for `:` with a shorter hex value to type when using Unicode input methods. - ⫶, the triple-colon operator U+2AF6: force creation of a NamedParam with the object on its LHS as the name. Whereas the normal NamedParam colon operator `a: val` expects a bareword on its LHS, the triple-colon evaluates its left hand side and therefore allows any value from a names or expressions as the name in a NamedParam. Previously, it wasn't possible to generate NamedParams without `eval` because of the bareword restriction.
652577d
to
4ed066c
Compare
Deprecate the
:
(colon) method from Object.Starting with Sidef v4.0 it will be removed
from Object entirely, and only be used to
create Complex and standard named param-
eter syntax for Blocks (when its LHS is
a bareword).
The utility of
:
has been bisected into the:
(fat/fullwidth colon; more easily written
¦
) and⫶
(triple colon).:
as a Pair constructor remains for now, butcode using it should be updated to use the
new methods.
Object.:, the fullwidth colon U+FF1A:
force creation of a Pair from self and the first
argument.
Object.¦, the broken bar U+A6: alias for
:
with a shorter hex value to type when using
Unicode input methods.
⫶, the triple-colon operator U+2AF6:
force creation of a NamedParam with the object
on its LHS as the name.
Whereas the normal NamedParam colon operator
a: val
expects a bareword on its LHS,the triple-colon evaluates its left hand side
and therefore allows any value from a names
or expressions as the name in a NamedParam.
Previously, it wasn't possible to generate
NamedParams without
eval
because of thebareword restriction.