Giter Site home page Giter Site logo

Comments (8)

ignatov avatar ignatov commented on August 16, 2024

What's wrong with the first item?
Сan be arithmetic expressions places within the attributes? If not, I'll fix the first item as well.

from intellij-erlang.

vovakyrychenko avatar vovakyrychenko commented on August 16, 2024

it's a name/arity for functions and types. Same as -export([x/1]). Arithmetic expressions could not be put there to my knowledge. -attr(2/2) wont compile.

from intellij-erlang.

ignatov avatar ignatov commented on August 16, 2024

OK, I see, erlc reports an error 'bad attribute' for -attr(2/2).I'll fix the first one item.

from intellij-erlang.

vovakyrychenko avatar vovakyrychenko commented on August 16, 2024

no spaces in record fields assignment. There should be ones

    #x{
        id = <<"1">>,
        x = y
    }

from intellij-erlang.

vovakyrychenko avatar vovakyrychenko commented on August 16, 2024

extra tab of closing curly

-record(x, {
    x
}).

from intellij-erlang.

ignatov avatar ignatov commented on August 16, 2024

no spaces in record fields assignment. There should be ones

    #x{
        id = <<"1">>,
        x = y
    }

In standart library variant without spaces around = within record field is more frequent. So, this space is a good candidate for code style preferences. At the moment, I leave variant without spaces.

from intellij-erlang.

vovakyrychenko avatar vovakyrychenko commented on August 16, 2024

But it introduces compilation errors into syntactically correct code. This makes formatter unusable if there are binaries assigned to record fields - after formatting code wont compile - try this example:

-record(x, {
    x, id
}).
f() ->
   #x{
        id = <<"1">>,
        x = y
    }.

from intellij-erlang.

ignatov avatar ignatov commented on August 16, 2024

OK, I got your point.

from intellij-erlang.

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.