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 ())
else do
isD <- liftIO $ doesDirectoryExist fn
if not isD then exit ()
else do
when isD do
content <- liftIO (try @_ @IOError $ listDirectory fn)
<&> fromRight mempty
-- TODO: memory-hungry

View File

@ -867,6 +867,11 @@ internalEntries = do
pure $ if a == b then mkBool True else mkBool False
_ -> 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
[ListVal []] -> pure $ mkBool True
_ -> pure $ mkBool False