Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356975 - [Xbase] Support for procedures, i.e. "functions" of return type 'void'
Summary: [Xbase] Support for procedures, i.e. "functions" of return type 'void'
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.1.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P1 enhancement (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-07 13:21 EDT by Sven Efftinge CLA
Modified: 2017-09-19 17:12 EDT (History)
2 users (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Efftinge CLA 2011-09-07 13:21:15 EDT
In addition to the Funciton types in Functions we should provide support for Procedures, which are just like functions but without a retur value.
They area useful in all kinds of side effect situations like. e.g. foreach or the new builder syntax.
Comment 1 Meinte Boersma CLA 2011-10-05 09:32:45 EDT
Agree (for what it's worth ;))

Adding

	interface VoidFunction1<Param> {

		void apply(Param p);

	}

to o.e.x.x.l.Functions and a o.e.x.x.l.IterableExtensions#forEach with signature

public static final <T> void forEach(Iterable<T> iterable, VoidFunction1<? super T> function)

should do the trick and saves everyone from having to write .forEach(it|{it.doSomething; null})
Comment 2 Sebastian Zarnekow CLA 2011-10-10 09:05:43 EDT
Pushed to master.
Comment 3 Karsten Thoms CLA 2017-09-19 17:01:13 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:12:37 EDT
Closing all bugs that were set to RESOLVED before Neon.0