Bram Moolenaar
24fe33a83a
patch 9.0.0934: various code formatting issues
...
Problem: Various code formatting issues.
Solution: Improve code formatting.
2022-11-24 00:09:02 +00:00
Bram Moolenaar
82418263fa
patch 9.0.0618: calling function for reduce() has too much overhead
...
Problem: Calling function for reduce() has too much overhead.
Solution: Do not create a funccall_T every time.
2022-09-28 16:16:15 +01:00
Bram Moolenaar
1936c76536
patch 9.0.0617: calling function for reduce() has too much overhead
...
Problem: Calling function for reduce() has too much overhead.
Solution: Only call clear_tv() when needed.
2022-09-28 15:19:10 +01:00
Bram Moolenaar
52df40eb04
patch 9.0.0615: using reduce() on a list from range() is a bit slow
...
Problem: Using reduce() on a list from range() is a bit slow.
Solution: Avoid materializing the list.
2022-09-28 13:22:59 +01:00
Bram Moolenaar
f1c60d4bf1
patch 9.0.0548: reduce() with a compiled lambda could be faster
...
Problem: reduce() with a compiled lambda could be faster.
Solution: Call eval_expr_typval() instead of call_func() directly.
2022-09-22 17:07:00 +01:00
Bram Moolenaar
73e28dcc61
patch 9.0.0491: no good reason to build without the float feature
...
Problem: No good reason to build without the float feature.
Solution: Remove configure check for float and "#ifdef FEAT_FLOAT".
2022-09-17 21:08:33 +01:00
Bram Moolenaar
d83392a43a
patch 9.0.0345: error message for list argument could be clearer
...
Problem: Error message for list argument could be clearer.
Solution: Include the argument number. (Yegappan Lakshmanan, closes #11027 )
2022-09-01 12:22:46 +01:00
Bram Moolenaar
9ba6194d4c
patch 9.0.0338: return value of list_append_list() not always checked
...
Problem: Return value of list_append_list() not always checked.
Solution: Check return value and handle failure.
2022-08-31 11:25:06 +01:00
Yegappan Lakshmanan
04c4c5746e
patch 9.0.0335: checks for Dictionary argument often give a vague error
...
Problem: Checks for Dictionary argument often give a vague error message.
Solution: Give a useful error message. (Yegappan Lakshmanan, closes #11009 )
2022-08-30 19:48:24 +01:00
Bram Moolenaar
3e518a8ec7
patch 9.0.0331: cannot use items() on a string
...
Problem: Cannot use items() on a string.
Solution: Make items() work on a string. (closes #11016 )
2022-08-30 17:45:33 +01:00
Bram Moolenaar
976f859763
patch 9.0.0327: items() does not work on a list
...
Problem: items() does not work on a list. (Sergey Vlasov)
Solution: Make items() work on a list. (closes #11013 )
2022-08-30 14:34:52 +01:00
Bram Moolenaar
93a1096fe4
patch 8.2.5107: some callers of rettv_list_alloc() check for not OK
...
Problem: Some callers of rettv_list_alloc() check for not OK. (Christ van
Willegen)
Solution: Use "==" instead of "!=" when checking the return value.
2022-06-16 11:42:09 +01:00
Yegappan Lakshmanan
ca195cc84f
patch 8.2.5089: some functions return a different value on failure
...
Problem: Some functions return a different value on failure.
Solution: Initialize the return value earlier. (Yegappan Lakshmanan,
closes #10568 )
2022-06-14 13:42:26 +01:00
Bram Moolenaar
22ebd172e4
patch 8.2.4662: no error for using out of range list index
...
Problem: No error for using out of range list index.
Solution: Check list index at script level like in compiled function.
(closes #10051 )
2022-04-01 15:26:58 +01:00
Bram Moolenaar
f3980dc5d0
patch 8.2.4632: using freed memory in flatten()
...
Problem: Using freed memory in flatten().
Solution: Clear typval after recursing into list.
2022-03-26 16:42:23 +00:00
Bram Moolenaar
c6c1ec4da5
patch 8.2.4629: flattennew() makes a deep copy unnecessarily
...
Problem: flattennew() makes a deep copy unnecessarily.
Solution: Use a shallow copy. (issue #10012 )
2022-03-26 10:50:11 +00:00
Bram Moolenaar
acf7d73a7f
patch 8.2.4627: flatten() does not use maxdepth correctly
...
Problem: flatten() does not use maxdepth correctly.
Solution: Use a recursive implementation. (closes #10020 )
2022-03-25 19:50:57 +00:00
Bram Moolenaar
2007dd49f5
patch 8.2.4455: accepting one and zero for second sort() argument is strange
...
Problem: Accepting one and zero for the second sort() argument is strange.
Solution: Disallow using one and zero in Vim9 script.
2022-02-23 13:17:47 +00:00
Bram Moolenaar
46950b225f
patch 8.2.4295: Vim9: concatenating two lists may result in wrong type
...
Problem: Vim9: concatenating two lists may result in wrong type.
Solution: Remove the type instead of using list<any>. (closes #9692 )
2022-02-04 11:36:51 +00:00
Bram Moolenaar
7676c15879
patch 8.2.4293: Vim9: when copying a list it gets type list<any>
...
Problem: Vim9: when copying a list it gets type list<any> even when the
original list did not have a type.
Solution: Only set the type when the original list has a type. (closes #9692 )
2022-02-03 21:47:34 +00:00
Bram Moolenaar
381692b6f1
patch 8.2.4286: Vim9: strict type checking after copy() and deepcopy()
...
Problem: Vim9: strict type checking after copy() and deepcopy().
Solution: Allow type to change after making a copy. (closes #9644 )
2022-02-02 20:01:27 +00:00
=?UTF-8?q?Dundar=20G=C3=B6c?=
d5cec1f1f0
patch 8.2.4255: theoretical computation overflow
...
Problem: Theoretical computation overflow.
Solution: Perform multiplication in a wider type. (closes #9657 )
2022-01-29 15:19:23 +00:00
Bram Moolenaar
98cd30383a
patch 8.2.4232: some compilers don't like a goto label without statement
...
Problem: Some compilers don't like a goto label without statement.
Solution: Return instead of using a goto.
2022-01-27 17:37:41 +00:00
Bram Moolenaar
35c807df1f
patch 8.2.4231: Vim9: map() gives type error when type was not declared
...
Problem: Vim9: map() gives type error when type was not declared.
Solution: Only check the type when it was declared, like extend() does.
(closes #9635 )
2022-01-27 16:36:29 +00:00
Bram Moolenaar
04935fb17e
patch 8.2.4043: using int for second argument of ga_init2()
...
Problem: Using int for second argument of ga_init2().
Solution: Remove unnessary type cast (int) when using sizeof().
2022-01-08 16:19:22 +00:00
Bram Moolenaar
d82a47dd04
patch 8.2.4012: error messages are spread out
...
Problem: Error messages are spread out.
Solution: Move the last error messages to errors.h.
2022-01-05 20:24:39 +00:00
Bram Moolenaar
a6f7929e62
patch 8.2.4005: error messages are spread out
...
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
2022-01-04 21:30:47 +00:00
Bram Moolenaar
10d6f18b2f
patch 8.2.3997: Vim9: not enough testing for extend() and map()
...
Problem: Vim9: not enough testing for extend() and map().
Solution: Add more test cases. Fix uncovered problems. Remove unused type
fields.
2022-01-04 15:54:38 +00:00
Bram Moolenaar
078a46161e
patch 8.2.3996: Vim9: type checking lacks information about declared type
...
Problem: Vim9: type checking for list and dict lacks information about
declared type.
Solution: Add dv_decl_type and lv_decl_type. Refactor the type stack to
store two types in each entry.
2022-01-04 15:17:03 +00:00
Bram Moolenaar
ad8f248585
patch 8.2.3994: Vim9: extend() complains about type when it was not declared
...
Problem: Vim9: extend() complains about the type even when it was not
declared.
Solution: Only check the list or dict type when it was declared.
2022-01-03 16:52:28 +00:00
Bram Moolenaar
114dbda785
patch 8.2.3991: Vim9: error when extending dict<any>
...
Problem: Vim9: error when extending dict<any> with another type that it was
initialized with.
Solution: Also set the type for dict<any> if the initializer has a more
specific type. (closes #9461 )
2022-01-03 12:28:03 +00:00
Bram Moolenaar
3a846e6bca
patch 8.2.3972: error messages are spread out
...
Problem: Error messages are spread out.
Solution: Move the last errors from globals.h to errors.h.
2022-01-01 16:21:00 +00:00
Bram Moolenaar
460ae5dfca
patch 8.2.3967: error messages are spread out
...
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
2022-01-01 14:19:49 +00:00
Bram Moolenaar
436b5adc97
patch 8.2.3961: error messages are spread out
...
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
2021-12-31 22:49:24 +00:00
Bram Moolenaar
23018f2d4b
patch 8.2.3910: when compare function of sort() fails it does not abort
...
Problem: When the compare function of sort() produces and error then sort()
does not abort.
Solution: Check if did_emsg was incremented.
2021-12-27 11:54:37 +00:00
Bram Moolenaar
1802405d71
patch 8.2.3897: Vim9: second argument of map() and filter() not checked
...
Problem: Vim9: the second argument of map() and filter() is not checked at
compile time.
Solution: Add more specific type check for the second argument.
2021-12-25 21:43:28 +00:00
Yegappan Lakshmanan
f973eeb491
patch 8.2.3871: list.c contains code for dict and blob
...
Problem: List.c contains code for dict and blob.
Solution: Refactor to put code where it belongs. (Yegappan Lakshmanan,
closes #9386 )
2021-12-22 18:19:26 +00:00
Yegappan Lakshmanan
d92813a598
patch 8.2.3867: implementation of some list functions too complicated
...
Problem: Implementation of some list functions too complicated.
Solution: Refactor do_sort_uniq(), f_count() and extend() (Yegappan
Lakshmanan, closes #9378 )
2021-12-21 13:19:42 +00:00
Yegappan Lakshmanan
389b72196e
patch 8.2.3849: functions implementing reduce and map are too long
...
Problem: Functions implementing reduce and map are too long.
Solution: Use a function for each type of value. Add a few more test cases
and add to the help. (Yegappan Lakshmanan, closes #9370 )
2021-12-19 10:35:15 +00:00
rbtnn
0ccb5842f5
patch 8.2.3848: cannot use reduce() for a string
...
Problem: Cannot use reduce() for a string.
Solution: Make reduce() work with a string. (Naruhiko Nishino, closes #9366 )
2021-12-18 18:33:46 +00:00
Bram Moolenaar
2d877599ee
patch 8.2.3822: leaking memory in map() and filter(), no string in Vim9
...
Problem: Leaking memory in map() and filter(), cannot use a string argument
in Vim9 script.
Solution: Fix the leak, adjust the argument check, also run the tests as
Vim9 script. (Yegappan Lakshmanan, closes #9354 )
2021-12-16 08:21:09 +00:00
rbtnn
c479ce032f
patch 8.2.3818: cannot filter or map characters in a string
...
Problem: Cannot filter or map characters in a string.
Solution: Make filter() and map() work on a string. (Naruhiko Nishino,
closes #9327 )
2021-12-15 19:14:54 +00:00
Bram Moolenaar
851f86b951
patch 8.2.3796: the funcexe_T struct members are not named consistently
...
Problem: The funcexe_T struct members are not named consistently.
Solution: Prefix "fe_" to all the members.
2021-12-13 14:26:44 +00:00
Bram Moolenaar
40bcec1bac
patch 8.2.3750: error messages are everywhere
...
Problem: Error messages are everywhere.
Solution: Move more error messages to errors.h and adjust the names.
2021-12-05 22:19:27 +00:00
Yasuhiro Matsumoto
c04f62346b
patch 8.2.3449: sort fails if the sort compare function returns 999
...
Problem: Sort fails if the sort compare function returns 999.
Solution: Adjust value to -1 / 0 / 1. (Yasuhiro Matsumoto, closes #8884 )
2021-09-19 17:01:39 +02:00
Bram Moolenaar
b3bf33a7b2
patch 8.2.3427: double free when list is copied
...
Problem: Double free when list is copied.
Solution: Allocate the type when making a copy. (closes #8862 )
Clear the type for flattennew(). Avoid a memory leak when
flattennew() fails.
2021-09-11 20:20:38 +02:00
Bram Moolenaar
efc084e335
patch 8.2.3422: Vim9: no failure if return type differs from returned var
...
Problem: Vim9: no failure if return type differs from returned variable.
Solution: Copy type when copying a list. (closes #8847 )
2021-09-09 22:30:52 +02:00
Bram Moolenaar
89071cb6a1
patch 8.2.3338: Vim9: no type check when assigning a list range
...
Problem: Vim9: no type check when assigning a list range. (Naohiro Ono)
Solution: Check the member type. (closes #8750 )
2021-08-13 18:20:09 +02:00
Bram Moolenaar
92f05f21af
patch 8.2.3336: behavior of negative index in list change changed
...
Problem: Behavior of negative index in list change changed. (Naruhiko
Nishino)
Solution: Only change it for Vim9 script. (closes #8749 )
2021-08-12 21:12:56 +02:00
Bram Moolenaar
ef98257593
patch 8.2.3335: Vim9: not enough tests run with Vim9
...
Problem: Vim9: not enough tests run with Vim9.
Solution: Run a few more tests in Vim9 script and :def function. Fix that
items(), keys() and values9) return zero for a NULL dict.
Make join() return an empty string for a NULL list. Make sort()
return an empty list for a NULL list.
2021-08-12 19:27:57 +02:00