This message was deleted.
# java
s
This message was deleted.
🎖️ 1
p
That’s cool!
As long as we’re sharing alt-jvm lang code, here’s a snippet from my current project, which I’m currently migrating from ClojureScript (Clojure, but compiles to JavaScript) to Clojure (compiles to Java bytecode):
Copy code
(BucketOwnershipControls. bucket-name
                          (build BucketOwnershipControlsArgs
                                 :bucket (:id bucket)
                                 :rule (build BucketOwnershipControlsRuleArgs
                                              :object-ownership "BucketOwnerEnforced"))
                          (build CustomResourceOptions :parent bucket))
(
build
is a macro I wrote to make using builders more concise.)
m
does clojure have a way to omit the
BucketOwnershipControlsArgs
we were toying with the concept of lambda builders like such:
Copy code
new Profile("blah", pb -> pb
    .resourceGroupName(resourceGroup.getName())
    .location("global")
    .sku(sb -> sb.setName("name")) /// avoid referencing/importing Sku.Builder() since we can bind it in a lambda
);
p
Ah so using reflection to figure out what to build?
Yeah I could probably do that
It's a good idea, I'll give it a try
👍 1
m
well we have control over codegen so we were able to inline it when we were trying it out
p
Probably not necessary with Clojure, since it has macros
m
a very nice advantage.
p
I agree!