guicho271828 / trivia

Pattern Matcher Compatible with Optima
Other
334 stars 22 forks source link

PPCRE matcher to work on symbols #26

Closed PuercoPop closed 8 years ago

PuercoPop commented 8 years ago

Hi, This is a feature request. Currently the ppcre matcher only works on literal strings, would it be possible to treat symbols as potential variables?

For example

(let ((url-regexp "^/user/(\\w+/$)"))
  (match "/user/1/"
    ((ppcre url-regexp user-id) user-id)))

complains that url-regexp is not of type string. Being able to associate regexps with names that describe their intent is useful from a development experience point of view, even if at odds with efficiency.

guicho271828 commented 8 years ago

Interesting point. I will consider adding the suggested feature. In fact, the ppcre matcher is (in both optima and trivia) very much UNsophisticated/optimized, and there is plenty room for improvement.

guicho271828 commented 8 years ago

27

guicho271828 commented 8 years ago

it will work on forms, not only symbols.

PuercoPop commented 8 years ago

Thanks for the prompt implementation of the feature!