Hi all,

Chuck newbie here. Is it possible to pass a function as an argument? I'd
like to be able to  transform things in a functional programming manner.
As a trivial example, if I had an array of midi notes and wanted to raise
them all one interval.

    fun int increment(int note) {
        note + 1;
    }

    // use map to apply a function to all elements of an array
    map ( array_of_notes, increment);

thanks in advance,

John
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

Reply via email to