Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
0c30b890
Commit
0c30b890
authored
33 years ago
by
ram
Browse files
Options
Downloads
Patches
Plain Diff
Fixed %SP-STRING-SEARCH to actually work, and to have some reasonable
declarations.
parent
32fba76b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/mipsstrops.lisp
+14
-9
14 additions, 9 deletions
code/mipsstrops.lisp
with
14 additions
and
9 deletions
code/mipsstrops.lisp
+
14
−
9
View file @
0c30b890
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
;;;
(
ext:file-comment
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/mipsstrops.lisp,v 1.
6
199
1/11/09 02:47:18 wlott
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/mipsstrops.lisp,v 1.
7
199
2/03/14 02:18:07 ram
Exp $"
)
;;;
;;;
;;; **********************************************************************
;;; **********************************************************************
;;;
;;;
...
@@ -199,16 +199,21 @@ be simple strings."
...
@@ -199,16 +199,21 @@ be simple strings."
(
defun
%sp-string-search
(
string1
start1
end1
string2
start2
end2
)
(
defun
%sp-string-search
(
string1
start1
end1
string2
start2
end2
)
"%SP-String-Search String1, Start1, End1, String2, Start2, End2
"%SP-String-Search String1, Start1, End1, String2, Start2, End2
Searches for the substring of String1 specified in String2.
Searches for the substring of String1 specified in String2.
Returns an index into String2 or NIL if the substring wasn't
Returns an index into String2 or NIL if the substring wasn't
found."
found."
(
declare
(
simple-string
string1
string2
))
(
do
((
index2
start2
(
1+
index2
)))
(
do
((
index2
start2
(
1+
index2
)))
((
=
index2
end2
)
nil
)
((
=
index2
end2
)
nil
)
(
if
(
do
((
index1
start1
(
1+
index1
))
(
declare
(
fixnum
index2
))
(
index2
index2
(
1+
index2
)))
(
when
(
do
((
index1
start1
(
1+
index1
))
((
=
index1
end1
)
t
)
(
index2
index2
(
1+
index2
)))
(
if
(
char/=
(
char
string1
index1
)
(
char
string2
index2
))
((
=
index1
end1
)
t
)
(
declare
(
fixnum
index1
index2
))
(
when
(
=
index2
end2
)
(
return-from
%sp-string-search
nil
))
(
when
(
char/=
(
char
string1
index1
)
(
char
string2
index2
))
(
return
nil
)))
(
return
nil
)))
(
return
index2
))))
(
return
index2
))))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment