https://kotlinlang.org logo
Title
a

Andrew Gazelka

03/01/2019, 12:21 AM
iyo is using HOF with builder pattern sometimes bad because people can execute arbitrary code in them?
k

karelpeeters

03/01/2019, 12:24 AM
Just let people execute code if they want? I don't even think there's a way to do DSLs without HOF.
(FYI: you might want to put a
@DslMarker
on your builders)
a

Andrew Gazelka

03/01/2019, 4:40 PM
any way to make @DslMarker work for the
execute
HOF?
this is an excerpt
subCmd("subcmd2") {
                execute { sender, _, args ->
                    sender.sendMessage("Ran subcmd 2")
                }
            }