Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356975

Summary: [Xbase] Support for procedures, i.e. "functions" of return type 'void'
Product: [Modeling] TMF Reporter: Sven Efftinge <sven.efftinge>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P1 CC: meinte.boersma, sebastian.zarnekow
Version: 2.1.0Flags: sven.efftinge: indigo+
Target Milestone: SR2   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

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