Re: An Idea for Aliases

Oren Ben-Kiki <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <CADJiDhs7wAQVV2bowLaPe_uWknWAtOtgCcCUih5uWMiFUPL6gg@mail.gmail.com>
Hmmm. Sound interesting.

Does that mean it would be possible to relax the restriction that aliases
only point back? After all, if they are loaded to a "reference", and one
only de-references it after loading the whole structure, this should be
possible (though it would destroy the assumption of a
single-pass-de/serialization process). Perhaps such references would use a
different notation (**foo = point to foo anywhere in the document, as
opposed to *foo = point to a foo that was already defined).

Another, related intriguing option is to allow references by path instead
of by anchor. It is extremely useful to be able to say (for example) foo:
@bar.baz to refer to { bar: { baz: this_value } }. This doesn't work well
when one considers "aliases", but very well when one considers
"references". And this case obviously points to arbitrary position, either
before or after the reference point.

Definitely worth investigating further...

Oren.



On Mon, Nov 5, 2012 at 7:37 AM, Ingy dot Net <[email protected]> wrote:

> Greetings,
>
> I had an idea today. It probably would apply to YAML2 more than YAML. I
> just wanted to throw it out there, and see if people can shoot it down.
>
> The idea is to turn aliases into plain scalars, and the normal convention
> would be to load them as references to anchors. So things work as before
> under normal dump/load.
>
> Thus * is no longer a special syntax char and can start any plain scalar.
>
> This might be extended as the normal way to do other kinds of fancy
> impliciting like file includes:
>
> content: *include file.yaml
>
> Whether it gets used in new ways or not, I just think that *foo can be
> parsed as an implicit scalar. Can people see holes in that logic?
>
> Ingy
>
>
> ------------------------------------------------------------------------------
> LogMeIn Central: Instant, anywhere, Remote PC access and management.
> Stay in control, update software, and manage PCs from one command center
> Diagnose problems and improve visibility into emerging IT issues
> Automate, monitor and manage. Do more in less time with Central
> http://p.sf.net/sfu/logmein12331_d2d
> _______________________________________________
> Yaml-core mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/yaml-core
>
>

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d

_______________________________________________
Yaml-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yaml-core
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.