Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

More new features – parameters

Integrated Application Platform › Forums › Internals & Enhancements › More new features – parameters

  • This topic has 1 reply, 1 voice, and was last updated 10 years, 6 months ago by amckinlay.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 28, 2012 at 7:29 pm #734
    amckinlay
    Keymaster

    A couple more upcoming language features.

    Implicit Dynamic Parameters – you can now write:

    f = function(_foo) { Print(foo) }

    f(123) => 123

    _foo = 123; f() => 123

    This can be used with class methods as well as standalone functions. (But not with blocks.)

    One of the uses for this feature is to do dependency injection.

    The other feature is a shortcut. You can now write:

    class
    {
    New(.foo, .Bar)
    {
    ...
    }
    ...

    This is equivalent to:

    class
    {
    New(foo, bar)
    {
    .foo = foo
    .Bar = bar
    ...
    }
    ...

    The two features can also be combined:

    New(._foo)

    For more details, see my blog posts about these features:

    Implicit Dynamic Parameters
    More on Parameters

    July 31, 2012 at 2:58 am #934
    amckinlay
    Keymaster

    I just discovered that Google’s Dart language has a similar shortcut for parameters.

    class MyClass {
    String str;
    MyClass(this.str) {
    }

    Dart’s syntax is virtually identical to Suneido’s, except we can use .str as short for this.str

    It’s alway interesting to see different people converge on similar designs.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Internals & Enhancements’ is closed to new topics and replies.

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language