diff options
| author | Chouser <chouser@n01se.net> | 2015-02-19 18:34:59 -0500 |
|---|---|---|
| committer | Chouser <chouser@n01se.net> | 2015-02-21 13:22:44 -0500 |
| commit | 6512bd80002eb106a304b035e9592847d90ef23c (patch) | |
| tree | a6fd47e87c6f0762e556f42364bca7945e74c324 /forth/core.fs | |
| parent | 224e09ed42325f000ee9a31a500bebe03a1ba97c (diff) | |
| download | mal-6512bd80002eb106a304b035e9592847d90ef23c.tar.gz mal-6512bd80002eb106a304b035e9592847d90ef23c.zip | |
forth: Self-hosted mal passes all tests
Diffstat (limited to 'forth/core.fs')
| -rw-r--r-- | forth/core.fs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/forth/core.fs b/forth/core.fs index 4216574..1a1cc4d 100644 --- a/forth/core.fs +++ b/forth/core.fs @@ -202,12 +202,16 @@ defcore apply { argv argc -- val } more-args MalList/start @ final-argv list0len cells + final-argc list0len - cells cmove final-argv final-argc argv @ invoke ;; +defcore throw ( argv argc -- ) + drop @ to exception-object + 1 throw ;; defcore map? drop @ mal-type @ MalMap = mal-bool ;; defcore list? drop @ mal-type @ MalList = mal-bool ;; defcore vector? drop @ mal-type @ MalVector = mal-bool ;; defcore keyword? drop @ mal-type @ MalKeyword = mal-bool ;; defcore symbol? drop @ mal-type @ MalSymbol = mal-bool ;; +defcore atom? drop @ mal-type @ Atom = mal-bool ;; defcore true? drop @ mal-true = mal-bool ;; defcore false? drop @ mal-false = mal-bool ;; defcore nil? drop @ mal-nil = mal-bool ;; @@ -215,4 +219,6 @@ defcore nil? drop @ mal-nil = mal-bool ;; defcore sequential? drop @ sequential? ;; defcore keyword drop @ unpack-str MalKeyword. ;; -defcore symbol drop @ unpack-str MalSymbol. ;;
\ No newline at end of file +defcore symbol drop @ unpack-str MalSymbol. ;; + +defcore time-ms 2drop utime d>s 1000 / MalInt. ;; |
