Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

I was referring to the # pound syntax for fields. fields can be used with a . or - prefix much more pleasingly to the eyes. An untrained eye would take the # for comments.

    TestDomainObject {
      #created : DateAndTime [ '2012-02-14T16:40:15+01:00' ],
      #modified : DateAndTime [ '2012-02-14T16:40:18+01:00' ],
      #integer : 39581,
      #float : 73.84789359463944,
      #description : 'This is a test',
      #color : #green,
      #tags : [
        #two,
        #beta,
        #medium
      ],
      #bytes : ByteArray [ 'afabfdf61d030f43eb67960c0ae9f39f' ],
      #boolean : false
    }


sort by: page size:

* -- in my early years I used # as a comment in a bind zone file instead of ;

Nice! Pretty interesting syntax. Not sure about / for comments or the function argument syntax but you have a solid point about not using " or ' for strings!

Why?

I also use ###. It is just a different style.


admittedly there is the occasional moment I hit where I need an extra @ or @: so it's not perfect, but I have much less issue reading that format than the { true && <element /> } syntax, also think @if is a lot nicer than <if>.

Maybe just a personal thing.


It is explicit, in that one must use the f'' prefix. There are no syntax changes as u'', b'', and r'' already exist. Positionals make bugs more likely.

An even better one IMO is @, same thing as with # but it uses symbols.

Using 'is' and 'as' in this way is in line with C#.

And `PHP` has it, also! But I didn't see any big application/repository that uses `and` instead of `&&`, honestly.

I use that one quite a bit. Especially when I think of data that occurs in key/value pairs. The only problem is that I wish that the markup was <dt><dd></dd><dt> so that I the key/value pairs were in their own 'box' that could be styled more intuitively.

Yup.

The muscle memory is so strong, when writing Javascript/Typescript I type # by accident sometimes.

But then, // is one of the most commonly used operators in another language I use, so it's weirdly symmetrical :)


It can also be Perl, as Perl supports `s///` syntax.

Not completely, because the . has a meaning: select a member/field/slot from a class object.

I've often wondered about why /> syntax doesn't work on some elements. Now I know.

Thanks!


What syntax does it use? For example `|` doesn't seem to do anything.

And inclusion of @.

This makes sense, helping me get over the syntax of 'static' vs 'dynamic' in my mind thanks!

I think way way back (about 10 years ago) the syntax was

    &x\a
The current tick is much easier on the eyes.

I believe # is available as a symbol and I doesn't conflict with existing operators

IIRC, 'or' and || have different precedences in other languages, too - PHP, for example.
next

Legal | privacy