electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Another function inquery
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
wppk



Joined: Jan 25, 2008
Posts: 31
Location: Los Angeles

PostPosted: Wed Feb 20, 2008 2:32 pm    Post subject: Another function inquery
Subject description: returning multiple variables
Reply with quote  Mark this post and the followings unread

Is it possible to return more than one variable from a single function?
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Wed Feb 20, 2008 7:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

No, sorry, but I don't think so.
_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Wed Feb 20, 2008 8:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

Can't you pass a reference to a data structure to a function, such that the function could modify the data structure, most languages have at least that ... or otherwise can't a function return (a reference to) an object or an array that is created (or borrowed maybe in case it's a global thing) by the function?
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Thu Feb 21, 2008 2:43 am    Post subject: Reply with quote  Mark this post and the followings unread

Yes, I think so. You could make a class that would hold a whole set of data and return a instance of that.... but that's only a single "thing" that gets returned and the receiving function/construct would need to be able to use it.

I was asuming that the returned values would need to be acceptable to arbitrary functions that take multiple arguments, likes -say- filter coefficients.

I do think Ge was working on something like that, he also wanted "cross chucking" which I took to mean something like this;

(.8, 1.3, -0.7) => foo.coefficients;

This is useful because this;

Code:
c.somethingUseful( b.something ( a.something(argA, argB) ) );


is a lot less readable (if functionally equivalent) then;
Code:

a.something(argA, argB) => b.something => c.somethingUseful;


....however, without "crossChucKing" functions that take multiple parameters won't be able to benefit from that structure, which can force you to use inconsistent notation.

....At least that's what I took crossChucKing to be. It's been on The List for a long time.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use