5781
|
1 Summary of changes for version 3.0: |
2452
|
2 ---------------------------------- |
|
3 |
5814
|
4 ** The way Octave handles search paths has changed. Instead of |
|
5 setting the built-in variable LOADPATH, you must use addpath, |
|
6 rmpath, or path to manipulate the function search path. These |
|
7 functions will maintain "." at the head of the path, for |
|
8 compatibility with Matlab. |
|
9 |
|
10 Leading, trailing or doubled colons are no longer special. |
|
11 Now, all elements of the search path are explicitly included in |
|
12 the path when Octave starts. To display the path, use the path |
|
13 function. |
|
14 |
|
15 Path elements that end in // are no longer searched recursively. |
|
16 Instead, you may use addpath and the genpath function to add an |
|
17 entire directory tree to the path. For example, |
|
18 |
|
19 addpath (genpath ("~/octave")); |
|
20 |
|
21 will add ~/octave and all directories below it to the head of the |
|
22 path. |
|
23 |
|
24 |
|
25 ** Previous versions of Octave had a number of built-in variables to |
5781
|
26 control warnings (for example, warn_divide_by_zero). These |
|
27 variables have been replaced by warning identifiers that are used |
5794
|
28 with the warning function to control the state of warnings. |
|
29 |
|
30 For example, instead of writing |
2511
|
31 |
5781
|
32 warn_divide_by_zero = false; |
2452
|
33 |
5781
|
34 to disable divide-by-zero warnings, you should write |
2452
|
35 |
5781
|
36 warning ("off", "Octave:divide-by-zero"); |
2452
|
37 |
5781
|
38 You may use the same technique in your own code to control |
|
39 warnings. For example, you can use |
2452
|
40 |
5781
|
41 warning ("My-package:phase-of-the-moon", |
|
42 "the phase of the moon could cause trouble today"); |
2452
|
43 |
5781
|
44 to allow users to control this warning using the |
|
45 "My-package:phase-of-the-moon" warning identifier. |
2452
|
46 |
5781
|
47 You may also enable or disable all warnings, or turn them into |
|
48 errors: |
2452
|
49 |
5781
|
50 warning ("on", "all"); |
|
51 warning ("off", "all"); |
|
52 warning ("error", "Octave:divide-by-zero"); |
|
53 warning ("error", "all"); |
2452
|
54 |
5781
|
55 You can query the state of current warnings using |
2452
|
56 |
5781
|
57 warning ("query", ID) |
|
58 warning ("query") |
2452
|
59 |
5781
|
60 (only those warning IDs which have been explicitly set are |
|
61 returned). |
2459
|
62 |
5781
|
63 A partial list and description of warning identifiers is available |
|
64 using |
2452
|
65 |
5781
|
66 help warning_ids |
2452
|
67 |
|
68 |
5814
|
69 ** All built-in variables have been converted to functions. This |
5794
|
70 change simplifies the interpreter and allows a consistent |
|
71 interface to internal variables for user-defined packages and the |
|
72 core functions distributed with Octave. In most cases, code that |
|
73 simply accesses internal variables does not need to change. Code |
|
74 that sets internal variables will change. For example, instead of |
|
75 writing |
|
76 |
|
77 PS1 = ">> "; |
|
78 |
|
79 you will need to write |
|
80 |
|
81 PS1 (">> "); |
|
82 |
5798
|
83 If you need write code that will run in both old and new versions |
|
84 of Octave, you can use something like |
|
85 |
|
86 if (exist ("OCTAVE_VERSION") == 5) |
|
87 ## New: |
|
88 PS1 (">> "); |
|
89 else |
|
90 ## Old: |
|
91 PS1 = ">> "; |
|
92 endif |
5794
|
93 |
|
94 |
5781
|
95 See NEWS.2 for old news. |