Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsexplain
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verified Software
jsexplain
Commits
91dda212
Commit
91dda212
authored
9 years ago
by
Paul Iannetta
Committed by
Thomas Wood
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added a 'stack module' to be paired with calc.ml
parent
3634c98f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
generator/tests/calc.ml
+2
-0
2 additions, 0 deletions
generator/tests/calc.ml
generator/tests/stack.ml
+13
-0
13 additions, 0 deletions
generator/tests/stack.ml
with
15 additions
and
0 deletions
generator/tests/calc.ml
+
2
−
0
View file @
91dda212
open
Stack
type
expr
=
|
Const
[
@
f
value
]
of
int
|
Add
[
@
f
left
,
right
]
of
expr
*
expr
...
...
This diff is collapsed.
Click to expand it.
generator/tests/stack.ml
0 → 100644
+
13
−
0
View file @
91dda212
type
'
a
stack
=
|
Nil
|
Cons
[
@
f
value
,
stack
]
of
'
a
*
'
a
stack
let
is_empty
s
=
s
===
Nil
let
push
x
stack
=
Cons
(
x
,
stack
)
let
pop
stack
=
match
stack
with
|
Cons
(
x
,
xs
)
->
x
|
Nil
->
stuck
"Empty list"
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