Results 1 to 2 of 2

Thread: HOWTO use loadable modules in LianjaScript

  1. #1
    Senior Member
    Join Date
    Oct 2012
    Posts
    239

    Question HOWTO use loadable modules in LianjaScript

    if more than one of the modules in the list of the require (..) parameter contains the same procedure name as in the example:

    Code:
    public mylib = require (“mylib1”, “mylib2”) //, “mylib3”… etc
    
    value = mylib.myvar
    value = mylib.getMyVar ()
    after assigning a value, what will be the value of "value"? Which procedure is running? The order in which the parameter is listed? alphabetical order?

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    Try it and see.

    If you use more than one require parameter then those on the right override those on the left.

    this allows you to have a core library of procedures that can be overridden to support polymorphism..

    If that’s not what you want don’t use it for that purpose.

    If you are familiar with node,js require, or Python import this works in a similar way.
    .
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us