This commit is contained in:
parent
ebab58a3ae
commit
7437a31b89
1 changed files with 22 additions and 0 deletions
22
content/daily/2025-01-06.md
Normal file
22
content/daily/2025-01-06.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
+++
|
||||
title = 2025-01-06
|
||||
author = ["SouthFox"]
|
||||
date = 2025-01-06T23:33:00+08:00
|
||||
lastmod = 2025-01-06T23:45:53+08:00
|
||||
tags = ["publish"]
|
||||
draft = false
|
||||
+++
|
||||
|
||||
## Hy {#hy}
|
||||
|
||||
[API reference — Hy 1.0.0 manual](https://hylang.org/hy/doc/v1.0.0/api#for)
|
||||
|
||||
[hy]({{< relref "../main/20250106234212-hy.md" >}}) 里 `for` 里能引用之前的标识符,达到 `python` 里用多个 `for` 循环能表达同样的效果。
|
||||
|
||||
```hy
|
||||
(for [[root dirs files] (os.walk "source")
|
||||
-file files]
|
||||
(let [file (os.path.join root -file)]
|
||||
(when (and (in "posts" file) (file.endswith ".md"))
|
||||
(markdown-files.append file))))
|
||||
```
|
Loading…
Reference in a new issue