<div dir="ltr"><div class="gmail_default" style="font-family:monospace">Hello Amber Dev Team,</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">I have recently started playing with String Templates a lot more. They are an excellent feature that makes handling Strings safer and easier than before. I am pleasantly surprised.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">As the number of my String Templates grows (currently 6 on a single project), I am starting to think about how different String Template Processors work together.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Currently, I am working on building a SWING_HTML String Template Processor, which wraps the text into <html> tags, replaces new lines with <br>, and does escaping. However, I also want to be able to do Swing HTML things, like bolding, italicizing, and more. More specifically, I want to elevate this functionality into the type system. My initial instinct is to delegate the task to other processors. For example, SWING_HTML."Hello \{BOLD."\{name}"}!"<br></div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">However, one thing that I want to be able to do is to be able to ensure that, if I do (for example) delegate bolding to another processor, then that certain processor is only ever used with my SWING_HTML processor. As in, a BOLD template processor does not make much sense if it is being used outside of my SWING_HTML template processor.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">I am not particularly attached to the delegating (don't want this to become an XY problem). But the primary goal of being a one stop shop for all things Swing HTML -- is that something I can do with String Templates, where the individual components like bolding and italicizing can be lifted into the Java syntax? Or is that asking too much/not worth the effort -- I should just stick to writing tags manually/interpreting certain character sequences as bold or italicized?<br></div><div><br></div><div><div style="font-family:monospace" class="gmail_default">In the same vein, I have another question.</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">I am wondering if I am subtly drifting out of bounds of the goals of a String Template. The syntax is attractive, so I find myself using it often. However, I am starting to think that I am not using it for what it was meant for.</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">For example, in my SWING_HTML processor, I find myself just passing in arguments like so.</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">SWING_HTML."\{stringText}"</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">It's technically valid, but is this the sort of thing that should just be a method instead? Is it more of a subtle border/gradient that we should decide as a matter of trade offs?</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">Yet another question that builds off of the second one.</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">Oftentimes, we receive a String that we would like to break apart into parts so that we can put it back together safely. Breaking it apart into parts is not the responsibility of String Template Processor, but putting it back together safely 100% is. Since String Templates are now (or very soon to be) the de facto way of putting Strings together safely/properly, what would be the the way of breaking them apart safely/properly?</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">This question about parallelism in strategies is born out of seeing how you all are handling pattern-matching. Object construction and deconstruction are parallels of each other. It sort of leads me to wonder if there is a similar sort of play happening here for String deconstruction. My mind wants to say java.util.regex.Pattern/Matcher, but I want to confirm that.</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">Thank you for your time and help!</div><div style="font-family:monospace" class="gmail_default">David Alayachew<br></div><br></div></div>