~/talk

Kotlin DSL in under an hour

Talkat Voxxed Days Zurich 2019 · on Tuesday, 2019-03-19· [kotlin]
slides:none on file

Builds a working Kotlin internal DSL from Java library classes using concrete steps: convert Java to Kotlin, add extension functions and properties, replace Consumer with functional types and lambdas with receiver, use apply and inline helpers, and expose infix helpers for nicer literals. Implements nested-block syntax (client { twitter { handle "x" } company { name "y" } }) that compiles and runs, then prevents accidental receiver clashes by extending types and adding a DSL marker annotation so the DSL is reusable and type-safe.

AI-written summary · about

  1. 0:00Start
  2. 3:57give you a few examples of existing dsl
  3. 4:51define the layout of your android app
  4. 8:09transform an existing java code
  5. 11:12string interpolation with this expression syntax inside the strings
  6. 13:08creating the extension in coupling code for the client class
  7. 16:33the nested blocks
  8. 18:15define a block as a consumer interface
  9. 19:32create the anonymous implementation of that interface
  10. 20:34convert the interface to lambda
  11. 21:10remove the consumer interface
  12. 22:15creating the nested blocks
  13. 23:55an extension lambda
  14. 33:00using a dsl marker annotation
  15. 37:44adding the extension method to the integer
  16. 37:55add an extension
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.