GithubHelp home page GithubHelp logo

Comments (5)

39aldo39 avatar 39aldo39 commented on July 20, 2024 1

I have now added explicit support for Unicode characters!

from klfc.

39aldo39 avatar 39aldo39 commented on July 20, 2024

KLFC uses a normal JSON file, so you can use the syntax "\u2002" already.

from klfc.

kindaro avatar kindaro commented on July 20, 2024

I find it to be somewhat «wrong» to let the format of serialization define the ways in which I may or may not define a symbol, for the following reasons:

  • Formats come and go. Today it is JSON, tomorrow YAML, then Dhall.
  • Escape sequences are transient. For instance, if I convert a JSON file with both "—" and "\u2014" to YAML and back, I will either get two dashes or two escape sequences. The distinction will be lost.
  • When I wish to write a Unicode number of a symbol instead of the symbol itself, it is because I have an intention. A program should recognize and intrinsically acknowledge that intention, rather than making it «accidentally supported».

I am sure this change is technically feasible. If someone were to make it, would you merge?

from klfc.

39aldo39 avatar 39aldo39 commented on July 20, 2024

I don't think it necessarily wrong to let the format decide it, but I understand that the intention may be lost as most parsers throw away that information. However, it is also not very elegant to basically make your own escape sequences. For example, ligatures can currently be written as lig:U+2002, which outputs the literal string "U+2002". If you would also allow other notations, this becomes ambiguous. I don't know a nice solution for that.

from klfc.

kindaro avatar kindaro commented on July 20, 2024

I do observe that this feature works.

If in the future we want to make sure ligatures can include strings that resemble the notation for Unicode code points, we can allow for the specification of a key to include not only strings, but objects like {"type": "ligature", "contents": "U+2002"} which would output the literal string "U+2002", and even {"type": "ligature", "contents": ["U+2245", " is for isomorphose"]]} which would output the literal string "≅ is for isomorphose".

from klfc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.