This commit is contained in:
Dmitry Zuikov 2024-08-02 11:51:49 +03:00
parent 8ea325348a
commit 9ea1cd195c
2 changed files with 6 additions and 2 deletions

View File

@ -40,8 +40,7 @@ glob pat ignore dir action = runContT (callCC $ \exit -> go exit dir) pure
unless continue (exit ()) unless continue (exit ())
else do else do
isD <- liftIO $ doesDirectoryExist fn isD <- liftIO $ doesDirectoryExist fn
if not isD then exit () when isD do
else do
content <- liftIO (try @_ @IOError $ listDirectory fn) content <- liftIO (try @_ @IOError $ listDirectory fn)
<&> fromRight mempty <&> fromRight mempty
-- TODO: memory-hungry -- TODO: memory-hungry

View File

@ -867,6 +867,11 @@ internalEntries = do
pure $ if a == b then mkBool True else mkBool False pure $ if a == b then mkBool True else mkBool False
_ -> throwIO (BadFormException @c nil) _ -> throwIO (BadFormException @c nil)
entry $ bindMatch "length" $ \case
[ListVal es] -> pure $ mkInt (length es)
[StringLike es] -> pure $ mkInt (length es)
_ -> pure $ mkInt 0
entry $ bindMatch "nil?" $ \case entry $ bindMatch "nil?" $ \case
[ListVal []] -> pure $ mkBool True [ListVal []] -> pure $ mkBool True
_ -> pure $ mkBool False _ -> pure $ mkBool False