Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables with a period in the name fail #18

Open
AndrewHannigan opened this issue Jul 16, 2014 · 3 comments
Open

Variables with a period in the name fail #18

AndrewHannigan opened this issue Jul 16, 2014 · 3 comments

Comments

@AndrewHannigan
Copy link

Whisker seems to fail when there is a period in the name of the variable. Considering that R variables quite typically have periods in the name, this is problematic.

> whisker.render("{{user.name}}", list(user.name=342))
[1] ""
> whisker.render("{{username}}", list(username=342))
[1] "342"

If there is a way around this please let me know. I imagine it's a quick fix. Also if this is an intentional design choice that'd be good to know too. Thanks!

@AndrewHannigan AndrewHannigan changed the title variables with a period in the name fail Variables with a period in the name fail Jul 16, 2014
@edwindj
Copy link
Owner

edwindj commented Jul 20, 2014

Dear Andrew,

Responding from a hiking holiday with low internet access: in the latest
version on github it is possible to switch from "." to "$" as separation
symbol. The "." is the default so whisker conforms to the mustache standard.

Best regards,

Edwin
Op 16 jul. 2014 16:32 schreef "Andrew Hannigan" notifications@github.com:

Whisker seems to fail when there is a period in the name of the variable.
Considering that R variables quite typically have periods in the name, this
is very problematic.

whisker.render("{{user.name}}", list(user.name=342))
[1] ""
whisker.render("{{username}}", list(username=342))
[1] "342"

If there is a way around this please let me know. Also, if this is an
intentional design decision, it would be good to hear the reason for doing
so.


Reply to this email directly or view it on GitHub
#18.

@AndrewHannigan
Copy link
Author

Hi Edwin - thanks for the update, I'll check that out. Enjoy the views!

@kendonB
Copy link

kendonB commented Apr 18, 2017

I feel like it makes sense to use $ by default for the separation symbol. . is all ubiquitous in R object names. For example, make.names uses "." as the replacement when it sees a symbol it doesn't like:

make.names("var$name")
#> [1] "var.name"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants