Skip to content

Remove cyclic dependencies between functions #154

Closed

Description

@peq

By creating one big function with an extra parameter to distinguish the functions.

Activity

  1. Frotty commented on Sep 3, 2013

    @Frotty
    Member

    Or a code variable

  2. peq commented on Sep 7, 2013

    @peq
    CollaboratorAuthor

    But code variable only works with function references, not with normal calls.

  3. added a commit that references this issue on Apr 6, 2014
  4. Cokemonkey11 commented on Sep 15, 2015

    @Cokemonkey11
    Collaborator

    @peq is there documentation somewhere that explains how to use this?

    There is no information about limitations of ExecuteFunc in the Wurst manual.

  5. peq commented on Sep 16, 2015

    @peq
    CollaboratorAuthor

    ExecuteFunc can only be used with static strings. It is statically checked whether the function exists.

    For cyclic dependencies between functions you don't have to do anything, it just works and you can look at the compiled output to see how.

  6. Cokemonkey11 commented on Sep 16, 2015

    @Cokemonkey11
    Collaborator

    Okay, so what's the best way to execute callback functions in Wurst?

  7. peq commented on Sep 16, 2015

    @peq
    CollaboratorAuthor

    I think objects/closures work best:

    http://peq.github.io/WurstScript/manual.html#lambda-expressions-and-closures

    In some cases it might be more efficient to use Conditions/triggers, but
    closures should be the default choice for callbacks.
    On Sep 16, 2015 7:47 PM, "Cokemonkey11" [email protected] wrote:

    Okay, so what's the best way to execute callback functions in Wurst?

    —
    Reply to this email directly or view it on GitHub
    #154 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions