string literals

About Monkey 2 Forums Monkey 2 Development string literals

This topic contains 1 reply, has 2 voices, and was last updated by  EdzUp 3 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #288

    dmaz
    Participant

    I’d really like to see something to help reduce all the quotes and plus signs for string construction…

    so instead of
    return “Vec2(“+x+”,”+y+”)”

    variable interpolation for string literals would be awesome
    return “Vec2($x,$y)”

    or a string class constructor that if has multiple params basically does a sprintf or format.
    return new string( “Vec2(%s,%s)”,x,y )

    what do you think?

    #289

    EdzUp
    Participant

    I personally like the ‘return new string ( “Vec2( %s, %s )”, x, y )’ as this is nearer to C but it might not be to everyones cup of tea so I would include the first one for compatibility with older blitz languages.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.