Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
faui2k17
generator
Commits
3a1b1555
Unverified
Commit
3a1b1555
authored
Aug 30, 2019
by
Philip Kaludercic
🌝
Browse files
fixed ordering bug
parent
6b5db779
Changes
1
Show whitespace changes
Inline
Side-by-side
local/micronews/paged-blog.scm
View file @
3a1b1555
...
...
@@ -13,22 +13,16 @@
listing.
See (haunt builder blog)'s blog for more details."
(
define
(
shorter-than
lst
n
)
(
cond
((
null?
lst
)
(
positive?
n
))
((
zero?
n
)
(
null?
lst
))
(
else
(
shorter-than
(
cdr
lst
)
(
1-
n
)))))
(
define
(
group-by
lst
n
)
(
cond
((
null?
lst
)
'
())
((
shorter-than
lst
n
)
(
list
lst
))
(
else
(
receive
(
head
rest
)
(
split-at
lst
n
)
(
cons
head
(
group-by
rest
n
))))))
(
let
loop
((
left
n
)
(
current
'
())
(
groups
'
())
(
rest
lst
))
(
cond
((
null?
rest
)
(
reverse!
(
cons
current
groups
)))
((
>
left
0
)
(
loop
(
1-
left
)
(
cons
(
car
rest
)
current
)
groups
(
cdr
rest
)))
(
else
(
loop
n
'
()
(
cons
(
reverse!
current
)
groups
)
rest
)))))
(
lambda
(
site
posts
)
(
let*
((
sorted
(
posts/reverse-chronological
posts
))
(
grouped
(
group-by
posts
per-page
))
(
grouped
(
group-by
(
reverse
sorted
)
per-page
))
(
last-group-nr
(
length
grouped
)))
(
define
(
create-index-page
group
i
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment