• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: a simple task for Simula based languages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a simple task for Simula based languages


  • Subject: Re: a simple task for Simula based languages
  • From: David Spooner <email@hidden>
  • Date: Sat, 17 Nov 2007 09:26:25 -0700

If you want to invoke the same method with a number of different arguments and collect the results using a convenient syntax, for example, a number of people have developed techniques for higher-order messaging in objective-c over the years. Here's a paper

http://www.metaobject.com/papers/Higher_Order_Messaging_OOPSLA_2005.pdf

Cheers,
dave

On 17-Nov-07, at 8:50 AM, Vlad Alexa wrote:

Sorry for not having the most correct code for illustration purposes.
It is a objective-c issue i am afraid however because if i have to return something like a NSMutableString i have to write it all in obj-c and with my limited experience of the language i have yet to find a way that looks good , so that is why i am asking.
And just for further reference the 3 consecutive dostuff calls are supposed to be different calls .


On Nov 17, 2007, at 5:36 PM, John Stiles wrote:

If you change "char" to "char*" in your code snippet below, this would work as written.
This seems like you just need to learn how C works. This isn't an Objective-C issue at all.



On Nov 17, 2007, at 1:15 AM, Vlad Alexa wrote:

//consider this code for a repetitive task 3 time here but it could be 30 times

dostufffor("This");
dostufffor("and");
dostufffor("other");

dostufffor("That");
dostufffor("and");
dostufffor("another");

dostufffor("Those");
dostufffor("and");
dostufffor("others");


//for a number of obvious reasons one would want to rewrite the code as below


mystuff ("This","and","other");
mystuff ("That","and","another");
mystuff ("Those","and","others");

void mystuff (char First, char Second, char Third)
{
		dostufffor(First);
		dostufffor(Second);
		dostufffor(Third);
}


//the question is , what is the best way to do this objective c ?




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >a simple task for Simula based languages (From: Vlad Alexa <email@hidden>)
 >Re: a simple task for Simula based languages (From: John Stiles <email@hidden>)
 >Re: a simple task for Simula based languages (From: Vlad Alexa <email@hidden>)

  • Prev by Date: Bridging C++ to Cocoa?
  • Next by Date: Re: a simple task for Simula based languages
  • Previous by thread: Re: a simple task for Simula based languages
  • Next by thread: Login Item for All Users
  • Index(es):
    • Date
    • Thread