diff options
| author | Mattias EngdegÄrd | 2024-05-07 12:17:39 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2024-05-07 12:29:48 +0200 |
| commit | c2bca6fe0f1c191444d2dc632190706b2a5b663d (patch) | |
| tree | 9d7be2456d0bfb95cb1a2b3295e3f05df6dae70d | |
| parent | 1ac70626fa6720a407a23b1b9c14364e5a9230ae (diff) | |
| download | emacs-c2bca6fe0f1c191444d2dc632190706b2a5b663d.tar.gz emacs-c2bca6fe0f1c191444d2dc632190706b2a5b663d.zip | |
* etc/NEWS: Elaborate `type` declare entry and regroup.
| -rw-r--r-- | etc/NEWS | 24 |
1 files changed, 18 insertions, 6 deletions
| @@ -1959,11 +1959,6 @@ unibyte string. | |||
| 1959 | 1959 | ||
| 1960 | * Lisp Changes in Emacs 30.1 | 1960 | * Lisp Changes in Emacs 30.1 |
| 1961 | 1961 | ||
| 1962 | +++ | ||
| 1963 | ** Function type declaration. | ||
| 1964 | It is now possible to declare the expected type of a function's | ||
| 1965 | arguments and its return type using the 'declare' macro. | ||
| 1966 | |||
| 1967 | ** New types 'closure' and 'interpreted-function'. | 1962 | ** New types 'closure' and 'interpreted-function'. |
| 1968 | 'interpreted-function' is the new type used for interpreted functions, | 1963 | 'interpreted-function' is the new type used for interpreted functions, |
| 1969 | and 'closure' is the common parent type of 'interpreted-function' | 1964 | and 'closure' is the common parent type of 'interpreted-function' |
| @@ -2452,8 +2447,25 @@ were used to customizing 'native-comp-async-report-warnings-errors' to | |||
| 2452 | nil or 'silent', we suggest that you now leave it at its default value, | 2447 | nil or 'silent', we suggest that you now leave it at its default value, |
| 2453 | and see if you get only warnings that matter. | 2448 | and see if you get only warnings that matter. |
| 2454 | 2449 | ||
| 2450 | ** Function 'declare' forms | ||
| 2451 | |||
| 2452 | +++ | ||
| 2453 | *** New 'type' function declaration. | ||
| 2454 | The declaration '(type TYPE)' specifies the type of a function. | ||
| 2455 | Example: | ||
| 2456 | |||
| 2457 | (defun hello (x y) | ||
| 2458 | (declare (type (function (integer boolean) string))) | ||
| 2459 | ...) | ||
| 2460 | |||
| 2461 | specifies that the function takes two arguments, an integer and a | ||
| 2462 | boolean, and returns a string. This information can be used by the | ||
| 2463 | native compiler to produce better code, but specifying an incorrect type | ||
| 2464 | may lead to Emacs crashing. See the Info node "(elisp) Declare Form" | ||
| 2465 | for further information. | ||
| 2466 | |||
| 2455 | +++ | 2467 | +++ |
| 2456 | ** New function declaration and property 'important-return-value'. | 2468 | *** New 'important-return-value' function declaration and property. |
| 2457 | The declaration '(important-return-value t)' sets the | 2469 | The declaration '(important-return-value t)' sets the |
| 2458 | 'important-return-value' property which indicates that the function | 2470 | 'important-return-value' property which indicates that the function |
| 2459 | return value should probably not be thrown away implicitly. | 2471 | return value should probably not be thrown away implicitly. |