Skip to content

Commit

Permalink
fixed deprecation messages outside of @deprecated tags
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Nov 7, 2024
1 parent 823f45c commit 5fe0f72
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/org/rascalmpl/library/List.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ dup([3, 1, 5, 3, 1, 7, 1, 2]);
list[&T] dup(list[&T] lst)
= ([] | (ix in it) ? it : it + [ix] | &T ix <- lst);

@deprecated{
Use a list index instead
}
@deprecated Use a list index instead}
@javaClass{org.rascalmpl.library.Prelude}
java &T elementAt(list[&T] lst, int index);

Expand Down Expand Up @@ -481,7 +479,8 @@ push("eagle", ["zebra", "elephant", "snake", "owl"]);
list[&T] push(&T elem, list[&T] lst) = [elem] + lst;
@synopsis{Apply a function to successive elements of list and combine the results (__deprecated__).}
@synopsis{Apply a function to successive elements of list and combine the results.}
@deprecated{This function is deprecated. Use a reducer expression instead, like `(init | f(it, e) | e <- lst)`.}
@description{
Apply the function `fn` to successive elements of list `lst` starting with `unit`.
}
Expand All @@ -492,14 +491,6 @@ int add(int x, int y) { return x + y; }
reducer([10, 20, 30, 40], add, 0);
```
}
@benefits{
}
@pitfalls{
:::warning
This function is *deprecated*, use a reducer expression instead. E.g. `(init | f(it, e) | e <- lst)`.
:::
}
&T reducer(list[&T] lst, &T (&T, &T) fn, &T unit)
{
&T result = unit;
Expand Down

0 comments on commit 5fe0f72

Please sign in to comment.