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

Standard library #54

Open
HallM opened this issue Jul 26, 2016 · 0 comments
Open

Standard library #54

HallM opened this issue Jul 26, 2016 · 0 comments

Comments

@HallM
Copy link
Collaborator

HallM commented Jul 26, 2016

May need a sort of standard library for certain things, especially in dealing with strings. I am not certain if Math (cos, sin, pi, etc) or array/collection manipulation would be necessary. I feel these may cross the line of what a view engine should do whereas substring is something a view engine may need to do. Displaying a portion of a string can be display logic. Manipulating data should be business logic.

Strings

  • string concatenation
  • substring
  • length
  • toUpperCase
  • toLowerCase
  • matches
  • path to width and justify left/right/center
  • trim left/right/both
  • startswith
  • endswith

Array

  • length
  • slice
  • join

Not certain if these have a strong use case, especially with how the display/block logic works. They can't function at this time. To make blocks more like functions would shift more to general purpose programming language vs a template-focused language.

  • array reduce
  • array map
  • array filter
  • every (if all things in the array pass)
  • some (if one thing in the array passes)

Not sure if these string methods have a strong use case:

  • split
  • char at
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

1 participant