egison 0.3.0.0 → 0.3.0.1
raw patch · 3 files changed
+69/−21 lines, 3 files
Files
- Egison.hs +1/−19
- egison.cabal +2/−2
- etc/lib/basic.egi +66/−0
Egison.hs view
@@ -9,7 +9,7 @@ import IO hiding (try) welcomeMsg :: String-welcomeMsg = "Egison, version 0.3.0.0 : http://hagi.is.s.u-tokyo.ac.jp/~egi/egison/\nWelcome to Egison Interpreter!\n"+welcomeMsg = "Egison, version 0.3.0.1 : http://hagi.is.s.u-tokyo.ac.jp/~egi/egison/\nWelcome to Egison Interpreter!\n" byebyeMsg :: String byebyeMsg = "\nLeaving Egison.\nByebye. See you again! (^^)/\n"@@ -950,14 +950,6 @@ frames2 <- patternMatchListMap frames typesIValRefs patIValRefs rest return (frames1 ++ frames2) ---patternMatchListMapHelper :: [(Frame, IORef IntermidiateValue)] -> [IORef IntermidiateValue] -> [IORef IntermidiateValue] -> IOThrowsError [Frame]---patternMatchListMapHelper [] _ _ = return []---patternMatchListMapHelper ((frame, tgtIValRef):rests) typesIValRefs patIValRefs = do--- tgtIValRefs <- tupleToList tgtIValRef--- frames1 <- patternMatchList frames typesIValRefs patIValRefs tgtIValRefs--- frames2 <- patternMatchListMap frames typesIValRefs patIValRefs rest--- return (frames1 ++ frames2)- patternMatch :: [Frame] -> Value -> Value -> IORef IntermidiateValue -> IOThrowsError [Frame] patternMatch [] _ _ _ = return [] patternMatch frames _ (Pattern WildCard) _ = return frames@@ -1045,16 +1037,6 @@ connectFrames (frame:frames) newFrames = (map (\newFrame -> (appendFrames frame newFrame)) newFrames) ++ (connectFrames frames newFrames) ---extractAssocs :: Frame -> [String] -> IOThrowsError Frame---extractAssocs _ [] = return (Frame [])---extractAssocs frame (var:vars) =--- let mValRef = getValueFromFrame frame var in--- case mValRef of--- Nothing -> throwError (Default "extractAssocs")--- Just iValRef -> do newFrame <- extractAssocs frame vars--- case newFrame of--- Frame assocs -> return (Frame ((var, iValRef):assocs))- --- --- ---
egison.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.3.0.0+Version: 0.3.0.1 -- A short (one-line) description of the package. Synopsis: An Interpreter for the Programming Language Egison@@ -45,7 +45,7 @@ Data-Dir: etc/ -Data-files: lib/number.egi lib/collection.egi sample/number-test.egi sample/collection-test.egi sample/io-test.egi elisp/egison-mode.el+Data-files: lib/basic.egi lib/number.egi lib/collection.egi sample/number-test.egi sample/collection-test.egi sample/io-test.egi elisp/egison-mode.el -- Extra files to be distributed with the package, such as examples or -- a README.
+ etc/lib/basic.egi view
@@ -0,0 +1,66 @@+(define $Something+ (type+ {[$var-match (lambda [$tgt] {tgt})]+ }))++(define $Bool+ (type+ {[$var-match (lambda [$tgt] {tgt})]+ [$inductive-match+ (deconstructor+ {[true []+ {[<true> {[]}]+ [_ {}]}]+ [false []+ {[<false> {[]}]+ [_ {}]}]+ })]+ [$equal?+ (lambda [$val $tgt]+ (match [val tgt] [Bool Bool]+ {[[<true> <true>] <true>]+ [[<false> <false>] <true>]+ [[_ _] <false>]}))]+ }))++(define $or+ (lambda [$b1 $b2]+ (match b1 Bool+ {[<true> <true>]+ [<false> b2]})))++(define $and+ (lambda [$b1 $b2]+ (match b1 Bool+ {[<true> b2]+ [<false> <false>]})))++(define $not+ (lambda [$b]+ (match b Bool+ {[<true> <false>]+ [<false> <true>]})))++(define $Order+ (type+ {[$var-match (lambda [$tgt] {tgt})]+ [$inductive-match+ (deconstructor+ {[less []+ {[<equal> {[]}]+ [_ {}]}]+ [equal []+ {[<equal> {[]}]+ [_ {}]}]+ [greater []+ {[<greater> {[]}]+ [_ {}]}]+ })]+ [$equal?+ (lambda [$val $tgt]+ (match [val tgt] [Order Order]+ {[[<less> <less>] <true>]+ [[<equal> <equal>] <true>]+ [[<greater> <greater>] <true>]+ [[_ _] <false>]}))]+ }))