Avatar
これ便利そうですね。 #Predicateを汎用的にしたバージョンみたいです。(Acceptedになってました) // Example models class Library { var albums: [Album] } class Album { var contents: [Photo] var isHidden: Bool } let libraryAlbumCountExpression = #Expression<Library, Int> { library in library.albums.filter { !$0.isHidden }.count } // Evaluate in-memory or pass to some API let numberOfAlbums = try libraryAlbumCountExpression.evaluate(someLibrary) https://forums.swift.org/t/review-sf-0006-expression-macro-and-type/70211
Hello Swift community, The review of SF-0006: #Expression Macro and Type begins now and runs through Thursday, Feb 29, 2024. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to me as the review manager by email or DM. When contacting the review manager directly, please put ...