Content deleted Content added
In Rust, to omit the curly braces in a closure, the return type must be inferred |
Rescuing 0 sources and tagging 1 as dead.) #IABot (v2.0.9.5 Tag: Reverted |
||
Line 1,450:
==== Visual Prolog ====
Anonymous functions (in general anonymous ''predicates'') were introduced in [[Visual Prolog]] in version 7.2.<ref>{{cite web |title=Anonymous Predicates |url=http://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms#Anonymous_Predicates }}{{Dead link|date=September 2023 |bot=InternetArchiveBot |fix-attempted=yes }} in Visual Prolog Language Reference</ref> Anonymous predicates can capture values from the context. If created in an object member, it can also access the object state (by capturing <code>This</code>).
<code>mkAdder</code> returns an anonymous function, which has captured the argument <code>X</code> in the closure. The returned function is a function that adds <code>X</code> to its argument:
|