-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Painless: Restructure Spec Documentation #31013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
99 commits
Select commit
Hold shift + click to select a range
153d376
Separate identifiers into its own section. Clean up variables.
jdconrad 6729d5f
More docs.
jdconrad 84048e4
Merge branch 'master' into docs1
jdconrad 10fca6c
Merge branch 'master' into docs1
jdconrad c2c3448
Modify language used to describe shallow copies.
jdconrad 1cdf013
Move examples into lists to make sections flow better when multiple
jdconrad 862962b
Update primitive types.
jdconrad 73883ac
Cleaned up reference types.
jdconrad 7dfb034
Clean up dynamic types.
jdconrad 75f1498
String and void type clean up.
jdconrad f75d50e
Merge branch 'master' into docs2
jdconrad 956a188
Merge branch 'master' into docs2
jdconrad bce78ed
Fixes.
jdconrad b034cff
Merge branch 'master' into docs2
jdconrad e82a1e0
Clean up types section.
jdconrad 1da1704
Merge branch 'master' into docs2
jdconrad 48b3aee
Merge branch 'master' into docs3
jdconrad 8bc0c74
Some casting and example clean up.
jdconrad 275c2e7
Merge branch 'master' into docs3
jdconrad 00ba531
Updated examples.
jdconrad 7bcd114
More changes.
jdconrad 84ea43d
Merge branch 'master' into docs3
jdconrad 1cf2f0b
Merge branch 'master' into docs3
jdconrad 68059ae
More example clean up.
jdconrad 73a24f0
More casting clean up.
jdconrad c3fcd67
More clean up.
jdconrad 19abc56
More changes.
jdconrad 00cf5df
Merge branch 'master' into docs3
jdconrad 0cb3e66
More fixes.
jdconrad bc4509f
Merge branch 'master' into docs3
jdconrad 507ac48
More example clean up.
jdconrad 7ad4ebb
More changes.
jdconrad a9c941e
Finished promotion and boxing/unboxing.
jdconrad 0007d26
Merge branch 'master' into docs2
jdconrad 988fc23
Cleaned up casting basic on PR comments.
jdconrad b95ce25
More changes.
jdconrad a8ed00b
Merge branch 'master' into docs2
jdconrad 7b73010
More fixes.
jdconrad 8fc4566
Fixed casting and types based on PR feedback.
jdconrad ca2bb83
Cleaned up more.
jdconrad ae1ae75
Extra blank lines at end of docs.
jdconrad a5cc47a
Merge branch 'master' into docs2
jdconrad 7b70e15
Start of structural change for operators.
jdconrad 093a10f
Moved operations to the appropriate pages.
jdconrad bb4dc1c
More clean up.
jdconrad 8f9b09e
Merge branch 'master' into docs5
jdconrad a122212
Added a casting table.
jdconrad 2665835
Switch assign/access to store/load in examples.
jdconrad aeb879b
Cleaned up some of the general operators.
jdconrad 7165b0f
Merge branch 'master' into docs5
jdconrad ba4b7c1
Merge branch 'master' into docs5
jdconrad b0c2512
Merge branch 'master' into docs5
jdconrad b1d31d1
Clean up of general operators.
jdconrad 246c824
Fix examples with load from instead of load.
jdconrad 4e2b89d
Update structure for long-term spec goals.
jdconrad 8b5316b
Merge branch 'master' into docs5
jdconrad 8302de3
Clean up numerical operators.
jdconrad 7ad8379
Merge branch 'master' into docs5
jdconrad 1d64edd
Merge branch 'docs5' into docs6
jdconrad 0696c83
Partially completed clean up of reference type operators.
jdconrad 46a868e
Completion of clean up of reference type operators.
jdconrad 15aac91
Clean up of array operators section.
jdconrad f85e235
Partially completed boolean operators clean up.
jdconrad 6f16058
More clean up.
jdconrad 775cfff
More clean up.
jdconrad 610d67c
Completion of operators clean up.
jdconrad 3b8da65
Fix Java to Painless.
jdconrad 33b7357
Merge branch 'master' into docs5
jdconrad d17c365
Merge branch 'master' into docs5
jdconrad a2afc62
Merge branch 'docs5' into docs6
jdconrad 8c87bf9
Merge branch 'docs6' into docs7
jdconrad 5b19038
Merge branch 'docs7' into docs8
jdconrad 46f737f
Merge branch 'docs8' into docs9
jdconrad 9439b92
Fix missing lang.
jdconrad 5aaa88a
Merge branch 'docs5' into docs6
jdconrad 86591c3
Merge branch 'docs6' into docs7
jdconrad d54e4a0
Fix missing lang.
jdconrad 23c2320
Merge branch 'docs7' into docs8
jdconrad fba0246
Merge branch 'docs8' into docs9
jdconrad 73ff8a2
Fix missing lang.
jdconrad 2b55029
Merge branch 'master' into docs5
jdconrad bdb8eb1
Merge branch 'docs5' into docs6
jdconrad 4e2994a
Merge branch 'docs6' into docs7
jdconrad a570d37
Merge branch 'docs7' into docs8
jdconrad 2e38982
Merge branch 'docs8' into docs9
jdconrad c688199
Response to PR review.
jdconrad 542f52e
Merge branch 'master' into docs5
jdconrad e0e7dce
Merge branch 'docs5' into docs6
jdconrad 603e5e5
PR response to numeric operators.
jdconrad afdc961
Merge branch 'docs6' into docs7
jdconrad 12fb54d
Response to PR comments for reference operators.
jdconrad c83ecaf
Merge branch 'docs7' into docs8
jdconrad be37bf1
Cleaned up array operators based on PR feedback.
jdconrad f0bd472
Merge branch 'docs8' into docs9
jdconrad c35e977
Clean up boolean operators based on PR feedback.
jdconrad 0760a41
Accidentally left in modified test.
jdconrad c361792
Response to more PR feedback.
jdconrad 038dd80
Merge branch 'master' into docs5
jdconrad d20d5d8
Merge branch 'master' into docs5
jdconrad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[[painless-functions]] | ||
=== Functions | ||
|
||
A function is a named piece of code comprised of one-to-many statements to | ||
perform a specific task. A function is called multiple times in a single script | ||
to repeat its specific task. A parameter is a named type value available as a | ||
<<painless-variables, variable>> within the statement(s) of a function. A | ||
function specifies zero-to-many parameters, and when a function is called a | ||
value is specified per parameter. An argument is a value passed into a function | ||
at the point of call. A function specifies a return type value, though if the | ||
type is <<void-type, void>> then no value is returned. Any non-void type return | ||
value is available for use within an <<painless-operators, operation>> or is | ||
discarded otherwise. | ||
|
||
You can declare functions at the beginning of a Painless script, for example: | ||
|
||
[source,painless] | ||
--------------------------------------------------------- | ||
boolean isNegative(def x) { x < 0 } | ||
... | ||
if (isNegative(someVar)) { | ||
... | ||
} | ||
--------------------------------------------------------- |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[[painless-lambdas]] | ||
=== Lambdas | ||
Lambda expressions and method references work the same as in https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html[Java]. | ||
|
||
[source,painless] | ||
--------------------------------------------------------- | ||
list.removeIf(item -> item == 2); | ||
list.removeIf((int item) -> item == 2); | ||
list.removeIf((int item) -> { item == 2 }); | ||
list.sort((x, y) -> x - y); | ||
list.sort(Integer::compare); | ||
--------------------------------------------------------- | ||
|
||
You can make method references to functions within the script with `this`, | ||
for example `list.sort(this::mycompare)`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beware that changing the anchors affects any cross-refs to these sections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the head up. I've been pretty good about compiling the docs and looking at the format each time I change something significant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I'm fairly confident nothing is referring to the headers outside the book since I've added the majority of them recently.