diff options
| author | Joel Martin <github@martintribe.org> | 2014-12-18 20:33:49 -0600 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-01-09 16:16:50 -0600 |
| commit | b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c (patch) | |
| tree | f4d977ed220e9a3f665cfbf4f68770a81e4c2095 /ps/types.ps | |
| parent | aaba249304b184e12e2445ab22d66df1f39a51a5 (diff) | |
| download | mal-b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c.tar.gz mal-b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c.zip | |
All: add keywords.
Also, fix nth and count to match cloure.
Diffstat (limited to 'ps/types.ps')
| -rw-r--r-- | ps/types.ps | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ps/types.ps b/ps/types.ps index 82be9c2..1f6903e 100644 --- a/ps/types.ps +++ b/ps/types.ps @@ -173,11 +173,34 @@ end } def % Symbols +/_symbol { + dup length string copy cvn +} def + /_symbol? { type /nametype eq } def +% Keywords + +/_keyword { 1 dict begin + /str exch def + str length 1 add string % str2 + dup 1 str putinterval + dup 0 127 put % TODO: something like (\x029e) would be better +end } def + +/_keyword? { + dup type /stringtype eq { + 0 get 127 eq + }{ + false + } ifelse +} def + + + % Functions % block -> _function -> boxed_function |
