Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fare-utils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
François-René Rideau
fare-utils
Compare Revisions
71f965fe8dd908fbb0eb1a7c73cb82e8195099bd...16a589ece0aa3ec91afd8f61d2ddf9a83472ebbc
Source
16a589ece0aa3ec91afd8f61d2ddf9a83472ebbc
Select Git revision
...
Target
71f965fe8dd908fbb0eb1a7c73cb82e8195099bd
Select Git revision
Compare
Commits (1)
1.0.0.2: Fix n-stream-has-char-p
· 16a589ec
Francois-Rene Rideau
authored
Jul 24, 2015
Add a test, update .asd file.
16a589ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
base/macros.lisp
base/macros.lisp
+5
-3
fare-utils.asd
fare-utils.asd
+3
-5
test/strings.lisp
test/strings.lisp
+11
-0
No files found.
base/macros.lisp
View file @
16a589ec
...
...
@@ -313,11 +313,13 @@ outputs a tag plus a list of variable and their values, returns the last value"
;;; Streams
(
defun
n-stream-has-char-p
(
c
s
)
(
and
(
peek-char
c
s
)
(
read-char
s
)))
(
and
(
eql
(
peek-char
nil
s
)
c
)
(
read-char
s
)))
(
defun
n-stream-eol-p
(
s
)
(
let
((
x
(
n-stream-has-char-p
#\return
s
)))
(
or
(
n-stream-has-char-p
#\linefeed
s
)
x
)))
(
let*
((
cr
(
n-stream-has-char-p
#\return
s
))
(
lf
(
n-stream-has-char-p
#\linefeed
s
)))
(
or
(
and
cr
lf
+crlf+
)
cr
lf
)))
; -----------------------------------------------------------------------------
;;; Higher-Order Functions
...
...
fare-utils.asd
View file @
16a589ec
;;; -*- Mode: Lisp ; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
(
defsystem
"fare-utils"
:version
"1.0.0.
1
"
:version
"1.0.0.
2
"
:description
"Basic functions and macros, interfaces, pure and stateful datastructures"
:long-description
"fare-utilities is a small collection of utilities.
It contains a lot of basic everyday functions and macros,
but also a library of pure and stateful datastructures,
and Lisp extensions for memoization and reader interception."
:long-description
"fare-utils is a small collection of utilities.
It contains a lot of basic everyday functions and macros"
:license
"MIT"
;; also BSD or bugroff
:author
"Francois-Rene Rideau"
:depends-on
((
:version
"asdf"
"3.0"
))
...
...
test/strings.lisp
View file @
16a589ec
...
...
@@ -11,3 +11,14 @@
(
deftest
test-join-strings
()
(
is
(
equal
(
join-strings
'
(
"/bin"
"/usr/bin"
"/usr/local/bin"
)
:separator
":"
)
"/bin:/usr/bin:/usr/local/bin"
)))
(
deftest
test-eol-p
()
(
with-input-from-string
(
s
(
format
nil
"x~cy~cz~at"
#\return
#\newline
+crlf+
))
(
is
(
equal
(
n-stream-eol-p
s
)
nil
))
(
is
(
equal
(
n-stream-eol-p
s
)
#\return
))
(
is
(
equal
(
n-stream-eol-p
s
)
nil
))
(
is
(
equal
(
n-stream-eol-p
s
)
#\newline
))
(
is
(
equal
(
n-stream-eol-p
s
)
nil
))
(
is
(
equal
(
n-stream-eol-p
s
)
+crlf+
))
(
is
(
equal
(
n-stream-eol-p
s
)
nil
))))