Skip to content
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

Path! syntax and date! syntax clash #2089

Open
rebolbot opened this issue Nov 6, 2013 · 8 comments
Open

Path! syntax and date! syntax clash #2089

rebolbot opened this issue Nov 6, 2013 · 8 comments

Comments

@rebolbot
Copy link
Collaborator

rebolbot commented Nov 6, 2013

Submitted by: Ladislav

In the example below there is a demonstration of a date! syntax and path! syntax "clash". The question is whether this is intended and whether it is optimal.

This is related to #2090.

I would like to be able to define a path containing a complete date value in some cases.

The last example is probably the worst since it is the hardest to amend.

>> to block! [6/Nov/2013/17:43]
== [6-Nov-2013/17:43]

>> to block! 'a/6/Nov/2013/17:43
== [a 6 Nov 2013 17:43]

>> to block! 'a/6-Nov-2013/17:43
== [a 6-Nov-2013 17:43]

>> type? load mold to path! [19 Nov 2013 21:01:51]
== date!

CC - Data [ Version: r3 master Type: Wish Platform: All Category: Syntax Reproduce: Always Fixed-in:none ]

@rebolbot
Copy link
Collaborator Author

Submitted by: Gregg

If you are saying that you want the following to be equivalent

'a/6/Nov/2013/17:43
'a/6-Nov-2013/17:43

I'll say -1, because it could lead to unexpected results. i.e., how do I escape it if I happen to have path values that would unintentionally become a date?

@rebolbot
Copy link
Collaborator Author

Submitted by: Ladislav

"If you are saying that you want the following to be equivalent..." - I am not saying that. I am saying that there is a "syntax clash" that causes problems.

@rebolbot
Copy link
Collaborator Author

Submitted by: Gregg

Ah, I think I see what you're saying now. You would have to put the date in a paren or something today. Do you have an idea for a cleaner solution?

@rebolbot
Copy link
Collaborator Author

Submitted by: Ladislav

The ISO date format does not "clash" with path syntax. Supporting ISO 8601 we will be better off in this sense as well. See #2092. Also, it is possible to use paren in path is some cases, which may be a way to circumvent the problem.

@rebolbot
Copy link
Collaborator Author

Submitted by: Gregg

I like that the slash in a date makes the time a refinement of the date, but it does clash in paths. I hesitate to suggest it, but "@" might be an understandable delimiter. It is non-standard, but reads well as "at" in this context. I also just found that REBOL can load it, thinking it's an email. e.g. 19-Nov-2013@12:30. Not all date forms load that way, and I very much doubt if anyone is using that feature that would complain about their code breaking.

That said, I can live with ISO8601, as I think it would be good to be able to load it in any case. I don't like the T, but the benefits may outweigh my feelings. :-)

@rebolbot
Copy link
Collaborator Author

Submitted by: Ladislav

The benefits of ISO will be:

  • standard compliance
  • improved compatibility between date syntax and path syntax

@rebolbot
Copy link
Collaborator Author

Submitted by: Ladislav

Regarding "I like that the slash in a date makes the time a refinement of the date" - understood, but, actually, I do not like this "benefit":

>> type? load mold to path! [19 Nov 2013 21:01:51]
== date!

Also, this is not easy to amend. Any idea?

@MarkEye
Copy link

MarkEye commented Mar 14, 2016

My idea has three parts:
(1) use MOLD/ALL
(2) MOLD/ALL of paths that don't begin with a word should put out construction syntax
(3) LOAD should be able to accept construction syntax for paths that do not begin with words

Oldes added a commit to Oldes/Rebol3 that referenced this issue Dec 17, 2018
… timezone, so subset of ISO8601 datetime values are loadable from Rebol.

Example:
```
>> 2013-11-08T17:01
== 8-Nov-2013/17:01
>> 2013-11-08T17:01+0100
== 8-Nov-2013/17:01+1:00
>> 2013-11-08T17:01Z
== 8-Nov-2013/17:01
```

Related issues:
metaeducation/rebol-issues#438
metaeducation/rebol-issues#2089
metaeducation/rebol-issues#2092
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants