Skip to content

Revive #1040 - spec/function.d#2004

Merged
CyberShadow merged 1 commit intodlang:masterfrom
wilzbach:1040-function
Jan 19, 2018
Merged

Revive #1040 - spec/function.d#2004
CyberShadow merged 1 commit intodlang:masterfrom
wilzbach:1040-function

Conversation

@wilzbach
Copy link
Copy Markdown
Contributor

Part of the revival of #1040.

@dlang-bot
Copy link
Copy Markdown
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Copy link
Copy Markdown
Member

@MetaLang MetaLang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a hanging closing paren in the rendered docs (not sure if it's caused by this PR or not):

image

spec/function.dd Outdated

$(P The maximum guarantee of `pure` is called "strong purity". It can enable
optimizations based on the fact
that a function is guaranteed to not mutate anyhing which isn't passed to it,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anyhing

spec/function.dd Outdated
$(P The maximum guarantee of `pure` is called "strong purity". It can enable
optimizations based on the fact
that a function is guaranteed to not mutate anyhing which isn't passed to it,
and in cases where the compiler can guarantee that a pure function cannot
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very long run-on sentence. Consider breaking it up.

and in cases where the compiler can guarantee that a pure function cannot
alter its arguments, it can enable full, functional purity (i.e. the guarantee
that the function will always return the same result for the same arguments).
To that end, a pure function:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is repeated again just below.

spec/function.dd Outdated
$(H2 $(LNAME2 interpretation, Compile Time Function Execution (CTFE)))

$(P Functions which are both portable and free of side-effects can be
$(P Functions which are both portable and free of side-effects to the global state can be
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better term might be "global side-effects".

spec/function.dd Outdated

$(UL
$(LI $(DDSUBLINK expression, ArrayLiteral, constructing an array) on the heap)
$(LI resizing an array with writing its $(D .length) property)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"with writing its" -> "by writing to its"

spec/function.dd Outdated
$(LI Cannot access $(D __gshared) variables.)
)

$(P With the array indexing and slicing, an out of bounds access
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be better written as "when indexing or slicing an array".

@wilzbach
Copy link
Copy Markdown
Contributor Author

wilzbach commented Jan 7, 2018

Addressed the review and found the stray parenthesis.

Copy link
Copy Markdown
Member

@quickfur quickfur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CyberShadow CyberShadow merged commit d6bbf61 into dlang:master Jan 19, 2018
@wilzbach wilzbach deleted the 1040-function branch January 19, 2018 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants