GithubHelp home page GithubHelp logo

Comments (5)

ctzurcanu avatar ctzurcanu commented on September 25, 2024

I would also love this. A lot of economy on typing the source. Of course the source will have to be pre-processed before parsing with the present parser... I have not found a JS transpiler to achieve this...

from nomnoml.

ctzurcanu avatar ctzurcanu commented on September 25, 2024

the advantage of using a transpiler would be that we can keep the present way of writing the source and add a second, more terse, version - without changing the grammar.

from nomnoml.

skanaar avatar skanaar commented on September 25, 2024

While I think this syntax is compatible, I would avoid adding more control characters to the language.
Semicolon already means linebreak when writing text inside a classifier and in the root scope. Having it mean something else when next to a classifier is probably a slippery slope towards trouble...

But the idea for a transpiler is interesting!

from nomnoml.

ctzurcanu avatar ctzurcanu commented on September 25, 2024

@skanaar I have already tried changing the nomnoml grammar for this and the problem was exactly where you expected: conflict between SEP and ";"
The problem with the transpiler is that we need to know the breakdown of association to re-write the source correctly.
An idea is to consider a middle ground:

[a]-[b];--[c];->[d]
can be

[a]-[b]
;--[c]
;->[d]

[a]-[b]*-[c]*-[d]
can be

[a]-[b]
*-[c]
*-[d]

and [foo]-[bar],[baz],[fighter],[bang]
can be written as

[foo]-[bar]
,[baz]
,[fighter]
,[bang]

It is still a much shorter source and changes to classnames have to be done in less places (should an update be necessary)

the changes are in association:

association
  : class IDENT class  
  | rep class   
  | oper IDENT class

also:

rep   :  ","
oper  
   : "*"
   | ";"

Also something about the SEP and IDENT, probably

from nomnoml.

skanaar avatar skanaar commented on September 25, 2024

Closing this as additional control characters will probably cause more trouble than it is worth.

from nomnoml.

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.