Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
buildsupport
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
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
TASTE
buildsupport
Commits
155f6c5d
Commit
155f6c5d
authored
Apr 03, 2017
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove direct access to value of option type
parent
7defe3c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ada/option_type.ads
ada/option_type.ads
+3
-3
No files found.
ada/option_type.ads
View file @
155f6c5d
...
...
@@ -8,8 +8,8 @@ package Option_Type is
type
Option
is
tagged
private
;
function
Just
(
I
:
T
)
return
Option
;
function
Nothing
return
Option
;
function
Just
(
O
:
Option
)
return
T
;
function
Value
(
O
:
Option
)
return
T
renames
Just
;
--
function Just (O : Option) return T;
--
function Value (O : Option) return T renames Just;
function
Value_Or
(
O
:
Option
;
Default
:
T
)
return
T
;
function
Has_Value
(
O
:
Option
)
return
Boolean
;
...
...
@@ -27,7 +27,7 @@ private
function
Nothing
return
Option
is
(
Present
=>
False
,
others
=>
<>
);
function
Just
(
O
:
Option
)
return
T
is
(
O
.
Value
);
--
function Just (O : Option) return T is (O.Value);
function
Value_Or
(
O
:
Option
;
Default
:
T
)
return
T
is
(
if
O
.
Present
then
O
.
Value
else
Default
);
...
...
Write
Preview
Markdown
is supported
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