Re: RFC: Single-Expression functions

From: Date: Tue, 27 May 2025 07:07:49 +0000
Subject: Re: RFC: Single-Expression functions
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-127473@lists.php.net to get a copy of this message
On May 26, 2025, at 11:05 PM, tovilo.ilija <tovilo.ilija@gmail.com> wrote: In the "Single-Expression functions in other languages" section, at least the Rust and Swift examples are wrong, as such a syntax does not exist for either of them. In case you got this info from an LLM, you should always fact-check whatever an AI tells you. Sure I did. Seems like I was confused by specifying a variable type along with the assigned value: Documentation <https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Using-Function-Types> docs.swift.org <https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Using-Function-Types> [image: favicon.ico] <https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Using-Function-Types> <https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Using-Function-Types> var mathFunction: (Int, Int) -> Int = addTwoInts I’ve double checked examples and removed Swift and Rust. Thanks for that. ---------- Best regards, Dmitrii Derepko. @xepozz

« previous php.internals (#127473) next »