ogrammer

Results 24 comments of ogrammer

Yes. You can access a map entry as a field (map.someKey or if you want map["someKey"] or dynamically map[keyFromVariable]), this is documented at https://pebbletemplates.io/wiki/guide/basic-usage/#variables. The documentation doesn't say it but...

> Behind the scenes foo.bar will attempt the following techniques to to access the bar attribute of the foo variable:

It is possible to tell the compiler to use it as a by doing `Map context = Map.of("name", name);`.

Apologies, I used a Map when testing it but as I use HashMap all the time I automatically wrote it as HashMap in my answer. And your idea seems nice,...

Actually, getTemplate throws no exception. Do you mean the `evaluate` method on PebbleTemplate?

This would break all try-catches that only have this method which throws an IOException.

This is a very serious issue as there is no possibility to cast or define variable type in pebble

Why are numbers long by default though, there would be next to no problem if default was int and 123L was long like in Java

@ebussieres Thanks, but how do I use longs if I do that? I need to kill support for one to use the other, does not seem very clean to me...

If the reason for using long by default is to support larger numbers then that does not make sense because the Java default is not so and to support larger...