-
Notifications
You must be signed in to change notification settings - Fork 170
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
String list new #680
base: master
Are you sure you want to change the base?
String list new #680
Conversation
The API for the module to manipulate lists of strings has been discussed and this has resulted in the current implementation
There was a typo in some comments - corrected
Document the linked_list type, including examples, and correct a few minor mistakes in the code.
Correct the subdirectory for the examples in the documentation.
Move the actual implementations of the linked list type (the linked list itself and the child list component) to the directory src.
Use an include statement instead of relying on the automatic module identification to get access to the print_list subroutine. As it is merely an auxiliary, it should not become part of the "official" source code.
Use an internal routine for print_list instead of an included module, as the buil process still wants to find the module's source.
Add the subdirectory "linked_list" to the overall CMake file and add a specific CMake file for the examples therein.
Rename the examples so that the names of the targets do not conflict with existing examples for other modules (notably in the strings subdirectory
Use a dedicated macro to make sure that the include directory is registered per target. It did not show up in the earlier attempt.
@@ -0,0 +1,17 @@ | |||
gfortran -c ../../src/stdlib_child_list.f90 |
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.
I guess that this file should be removed from the directory.
I think the fpm-deployment CI is failing because you need to update the |
Correct the CMakeLists.txt file in the src directory to include the linked list modules , also adjust the fpm-deployment.sh to copy any auxiliary source files from the example directory.
Rename the include file to "*.inc" so that it is no longer recognised by the build system. Of course, the example source files had to be adapted as well.
Correct the performance test program - apparently it was using some deprecated names and it was not built using the CMake build system.
Thanks for the comments. I was not sure how I could introduce an include directory, so instead I simply copy the extra file in to the example directory. I had to rename the file to something that is not confused with a separate Fortran program. Also I had to tweak the CMakeLists.txt files for the test program. I seem to be almost there, but the test program fails to run properly. Looking into that now. |
Update the test program to NOT read from stdin - that does not work in the CI build and execute environment.
The test program was failing because it tried to read from the keyboard. Changed it to simply use a length of one million elements. |
Create the missing CMake file for the test program.
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.
Thank you for this progress @arjenmarkus . Here are some suggestions.
Note that we use the suffix _type
for derived types in stdlib
.
--- | ||
title: stringlist | ||
--- | ||
# Lists of strings |
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.
What is the difference with the stdlib
stringlist_type
?
Thanks for the comments - I wil incorporate them in the documentation and
the source code. Note: I have been developing a more thorough test program
and found a few bugs, so these need to be repaired.
Linked lists are more general than the stringlist_type. I see the branch
has a misleading name. I will rename it, as it concerns the general list
type only.
Op di 26 dec 2023 om 00:41 schreef Jeremie Vandenplas <
***@***.***>:
… ***@***.**** commented on this pull request.
Thank you for this progress @arjenmarkus <https://github.com/arjenmarkus>
. Here are some suggestions.
Note that we use the suffix _type for derived types in stdlib.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+# The `stdlib_linked_list` module
+
+[TOC]
+
+## Introduction
+
+The `stdlib_linked_list` module defines a class and its interface to handle linked lists that
+store any type of data. The list may contain data of the same type or of various types.
+
+
+## Types
+
+### `type(linked_list)`
+
+Linked lists are variables of the type `linked_list`. The type provides all the methods
Types in stdlib should have the suffix _type in stdlib (see e.g.,
bitset_type, logger_type).
⬇️ Suggested change
-Linked lists are variables of the type `linked_list`. The type provides all the methods
+Linked lists are variables of the derived type `linked_list_type`. The derived type provides all the methods
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +title: linked lists
+---
+
+# The `stdlib_linked_list` module
+
+[TOC]
+
+## Introduction
+
+The `stdlib_linked_list` module defines a class and its interface to handle linked lists that
+store any type of data. The list may contain data of the same type or of various types.
+
+
+## Types
+
+### `type(linked_list)`
⬇️ Suggested change
-### `type(linked_list)`
+### The `linked_list_type` derived type
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +store any type of data. The list may contain data of the same type or of various types.
+
+
+## Types
+
+### `type(linked_list)`
+
+Linked lists are variables of the type `linked_list`. The type provides all the methods
+required for storing and retrieving data.
+
+
+## Procedures and methods provided
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `size`
⬇️ Suggested change
-### `size`
+### `size` - Return the number of data items in the list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+#### Status
+
+Experimental
+
+#### Class
+
+Pure function.
+
+#### Argument
+
+None
+
+#### Result value
+
+The result is the number of items currently contained in the list.
⬇️ Suggested change
-The result is the number of items currently contained in the list.
+The result is an integer scalar, equal to the number of items currently contained in the list.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+None
+
+#### Result value
+
+The result is the number of items currently contained in the list.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_size.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `clear`
⬇️ Suggested change
-### `clear`
+### `clear` - Remove all items from the list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+The result is the number of items currently contained in the list.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_size.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `clear`
+
+#### Description
+
+Remove all items from the list
⬇️ Suggested change
-Remove all items from the list
+Remove all items from the list.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +Subroutine.
+
+#### Argument
+
+None
+
+
+#### Example
+
+```fortran
+{!example/linked_list/example_clear.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `get`
⬇️ Suggested change
-### `get`
+### `get` - Get the data item at a given position in the list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+#### Syntax
+
+`item = [[stdlib_linked_list(module):list%get(interface)]] (node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Function.
+
+#### Argument
+
+- `node_index`: Position in the list for the new item (integer)
⬇️ Suggested change
-- `node_index`: Position in the list for the new item (integer)
+- `node_index`: Shall be a scalar integer equal to the position in the list for the new item.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Syntax
+
+`item = [[stdlib_linked_list(module):list%get(interface)]] (node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Function.
+
+#### Argument
+
+- `node_index`: Position in the list for the new item (integer)
+ This argument is intent(in).
⬇️ Suggested change
- This argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Status
+
+Experimental
+
+#### Class
+
+Function.
+
+#### Argument
+
+- `node_index`: Position in the list for the new item (integer)
+ This argument is intent(in).
+
+#### Result value
+
+The data item (of type class(*)) that is stored at the given position.
⬇️ Suggested change
-The data item (of type class(*)) that is stored at the given position.
+The data item (of type `class(*)`) that is stored at the given position.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +The data item (of type class(*)) that is stored at the given position.
+
+Notes:
+
+- If the index is 0 or less, the first item in the list is returned.
+- If the index is larger than the number of items, the last item in the list is returned.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_get.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `insert`
⬇️ Suggested change
-### `insert`
+### `insert` - Insert a new item at a given position in the list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Syntax
+
+`call [[stdlib_linked_list(module):list%insert(interface)]] (item, node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `item`: Data item to be stored (any type).
+ This argument is intent(in).
⬇️ Suggested change
- This argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+`call [[stdlib_linked_list(module):list%insert(interface)]] (item, node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `item`: Data item to be stored (any type).
+ This argument is intent(in).
+- `node_index`: Position in the list for the new item (integer)
⬇️ Suggested change
-- `node_index`: Position in the list for the new item (integer)
+- `node_index`: Shall be a scalar integer equal to the position in the list for the new item.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +`call [[stdlib_linked_list(module):list%insert(interface)]] (item, node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `item`: Data item to be stored (any type).
+ This argument is intent(in).
+- `node_index`: Position in the list for the new item (integer)
+ This argument is intent(in).
⬇️ Suggested change
- This argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +The list is extended with the new data item at the given position.
+
+Notes:
+
+- If the index is 0 or less, the item is stored at the first position.
+- If the index is larger than the number of items, it will be appended to the end of the list.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_insert.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `replace`
⬇️ Suggested change
-### `replace`
+### `replace` - Replace an existing data by a new item at a given position in the list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+#### Syntax
+
+`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `item`: The new data item to be stored (any type).
⬇️ Suggested change
-- `item`: The new data item to be stored (any type).
+- `new_item`: The new data item to be stored (any type).
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Syntax
+
+`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `item`: The new data item to be stored (any type).
+ This argument is intent(in).
⬇️ Suggested change
- This argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `item`: The new data item to be stored (any type).
+ This argument is intent(in).
+- `node_index`: Position in the list for the item to be replaced (integer)
⬇️ Suggested change
-- `node_index`: Position in the list for the item to be replaced (integer)
+- `node_index`: Shall be a scalar integer equal to the position in the list for the item to be replaced.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `item`: The new data item to be stored (any type).
+ This argument is intent(in).
+- `node_index`: Position in the list for the item to be replaced (integer)
+ This argument is intent(in).
⬇️ Suggested change
- This argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+The new data item is stored and the existing one removed.
+
+Notes:
+
+- If the index is 0 or less, or it is larger than the number of items, nothing is done.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_replace.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `remove`
⬇️ Suggested change
-### `remove`
+### `remove` - Remove an items at a given position in the list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+#### Syntax
+
+`call [[stdlib_linked_list(module):list%remove(interface)]] (node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `node_index`: Position in the list for the item to be removed (integer)
⬇️ Suggested change
-- `node_index`: Position in the list for the item to be removed (integer)
+- `node_index`: Shall be a scalar integer equal to the position in the list for the item to be removed.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Syntax
+
+`call [[stdlib_linked_list(module):list%remove(interface)]] (node_index)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `node_index`: Position in the list for the item to be removed (integer)
+ This argument is intent(in).
⬇️ Suggested change
- This argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Result value
+
+The indicated item has been removed from the list.
+
+Notes:
+
+- If the index is 0 or less or the index is larger than the number of items, nothing is done.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_remove.f90!}
+```
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `push`
⬇️ Suggested change
-### `push`
+### `push` - Append a new item to the end of the list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Syntax
+
+`call [[stdlib_linked_list(module):list%push(interface)]] (item)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `item`: Data item to be stored (any type).
+ This argument is intent(in).
⬇️ Suggested change
- This argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +- `item`: Data item to be stored (any type).
+ This argument is intent(in).
+
+#### Result value
+
+The list is extended with the new data item at the tail.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_push.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `pop`
⬇️ Suggested change
-### `pop`
+### `pop` - Remove the last item in the list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+None
+
+#### Result value
+
+The list item in the list is removed.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_pop.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `reverse`
⬇️ Suggested change
-### `reverse`
+### `reverse` - Reconstruct the list in reverse order
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+None
+
+#### Result value
+
+The list now contains the items in reverse order.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_reverse.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `concat`
⬇️ Suggested change
-### `concat`
+### `concat` - Concatenate a list to another list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+#### Syntax
+
+`call [[stdlib_linked_list(module):list%concat(interface)]] (list_to_concat)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
⬇️ Suggested change
-- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
+- `list_to_concat`: list whose data items are to be appended to the given `linked_list_type` derived type.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Syntax
+
+`call [[stdlib_linked_list(module):list%concat(interface)]] (list_to_concat)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
+ this argument is intent(in).
⬇️ Suggested change
- this argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
+ this argument is intent(in).
+
+#### Result value
+
+The given list is extended with the data items in the second list. The second list remains intact.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_concat.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `absorb`
⬇️ Suggested change
-### `absorb`
+### `absorb` - Absorb a list into another list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+#### Syntax
+
+`call [[stdlib_linked_list(module):list%absorb(interface)]] (list_to_concat)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
⬇️ Suggested change
-- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
+- `list_to_absorb`: list whose data items will be appended to the given `linked_list_type` derived type.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Syntax
+
+`call [[stdlib_linked_list(module):list%absorb(interface)]] (list_to_concat)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
+ this argument is intent(inout).
⬇️ Suggested change
- this argument is intent(inout).
+ This argument is `intent(inout)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
+ this argument is intent(inout).
+
+#### Result value
+
+The given list is extended with the data items in the second list. The second list is emptied.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_absorb.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `slice`
⬇️ Suggested change
-### `slice`
+### `slice` - Return a sublist of a list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+#### Syntax
+
+`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `start`: first item to store in the sublist (integer)
⬇️ Suggested change
-- `start`: first item to store in the sublist (integer)
+- `start`: Shall be a scalar integer equal to the first item to store in the sublist.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +
+`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `start`: first item to store in the sublist (integer)
+ this argument is intent(in).
+- `end`: last item to store in the sublist (integer)
⬇️ Suggested change
-- `end`: last item to store in the sublist (integer)
+- `end`: Shall be a scalar integer equal to the last item to store in the sublist.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +#### Syntax
+
+`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `start`: first item to store in the sublist (integer)
+ this argument is intent(in).
⬇️ Suggested change
- this argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
+
+#### Status
+
+Experimental
+
+#### Class
+
+Subroutine.
+
+#### Argument
+
+- `start`: first item to store in the sublist (integer)
+ this argument is intent(in).
+- `end`: last item to store in the sublist (integer)
+ this argument is intent(in).
⬇️ Suggested change
- this argument is intent(in).
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> + this argument is intent(in).
+
+#### Result value
+
+Sublist consisting of the indicated data items. Note that the items themselves are copied from the original
+list, so that the two lists are independent.
+
+#### Example
+
+```fortran
+{!example/linked_list/example_slice.f90!}
+```
+
+
+<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
+### `splice`
⬇️ Suggested change
-### `splice`
+### `splice` - Remove a sublist from a list
------------------------------
In doc/specs/stdlib_linked_list.md
<#680 (comment)>:
> +- `start`: first item to be removed in the sublist (integer)
+ this argument is intent(in).
+- `end`: last item to be removed in the sublist (integer)
+ this argument is intent(in).
⬇️ Suggested change
-- `start`: first item to be removed in the sublist (integer)
- this argument is intent(in).
-- `end`: last item to be removed in the sublist (integer)
- this argument is intent(in).
+- `start`: Shall be a scalar integer equal to the first item to be removed in the sublist.
+ This argument is `intent(in)`.
+- `end`: Shall be a scalar integer equal to the last item to be removed in the sublist.
+ This argument is `intent(in)`.
------------------------------
In doc/specs/stdlib_stringlist.md
<#680 (comment)>:
> @@ -0,0 +1,487 @@
+---
+title: stringlist
+---
+# Lists of strings
What is the difference with the stdlib stringlist_type
<https://github.com/fortran-lang/stdlib/blob/master/doc/specs/stdlib_stringlist_type.md>
?
—
Reply to this email directly, view it on GitHub
<#680 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YRZKUF3L7TZYA6XNIGTYLIFLJAVCNFSM6AAAAAAQPNXWX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJVHE3DCNBYGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Updated the documentation after review by jvdp1. Adjusted the type name (suffix _type) and applied several cosmetic changes. Also added a more extensive test program and fixed several bugs.
As the type is now "linked_list_type", the examples had to be adjusted. There turned out to be a bug regarding the intent for the get() function. This has been repaired.
… into linked-list-new
The file "linked_list_aux.inc" was not found - fpm test.
Something went wrong with the included routine in the examples. So instead, simply copy the source code for it in all examples.
Just pushed the changes, but the fpm build is failing on the small
auxiliary include file I use in the examples. Quickest fix: include the
code rather than use an include file. Now let us see whether that worked.
Op do 28 dec 2023 om 14:36 schreef Arjen Markus ***@***.***>:
… Thanks for the comments - I wil incorporate them in the documentation and
the source code. Note: I have been developing a more thorough test program
and found a few bugs, so these need to be repaired.
Linked lists are more general than the stringlist_type. I see the branch
has a misleading name. I will rename it, as it concerns the general list
type only.
Op di 26 dec 2023 om 00:41 schreef Jeremie Vandenplas <
***@***.***>:
> ***@***.**** commented on this pull request.
>
> Thank you for this progress @arjenmarkus <https://github.com/arjenmarkus>
> . Here are some suggestions.
> Note that we use the suffix _type for derived types in stdlib.
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +# The `stdlib_linked_list` module
> +
> +[TOC]
> +
> +## Introduction
> +
> +The `stdlib_linked_list` module defines a class and its interface to handle linked lists that
> +store any type of data. The list may contain data of the same type or of various types.
> +
> +
> +## Types
> +
> +### `type(linked_list)`
> +
> +Linked lists are variables of the type `linked_list`. The type provides all the methods
>
> Types in stdlib should have the suffix _type in stdlib (see e.g.,
> bitset_type, logger_type).
> ⬇️ Suggested change
>
> -Linked lists are variables of the type `linked_list`. The type provides all the methods
> +Linked lists are variables of the derived type `linked_list_type`. The derived type provides all the methods
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +title: linked lists
> +---
> +
> +# The `stdlib_linked_list` module
> +
> +[TOC]
> +
> +## Introduction
> +
> +The `stdlib_linked_list` module defines a class and its interface to handle linked lists that
> +store any type of data. The list may contain data of the same type or of various types.
> +
> +
> +## Types
> +
> +### `type(linked_list)`
>
> ⬇️ Suggested change
>
> -### `type(linked_list)`
> +### The `linked_list_type` derived type
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +store any type of data. The list may contain data of the same type or of various types.
> +
> +
> +## Types
> +
> +### `type(linked_list)`
> +
> +Linked lists are variables of the type `linked_list`. The type provides all the methods
> +required for storing and retrieving data.
> +
> +
> +## Procedures and methods provided
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `size`
>
> ⬇️ Suggested change
>
> -### `size`
> +### `size` - Return the number of data items in the list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Pure function.
> +
> +#### Argument
> +
> +None
> +
> +#### Result value
> +
> +The result is the number of items currently contained in the list.
>
> ⬇️ Suggested change
>
> -The result is the number of items currently contained in the list.
> +The result is an integer scalar, equal to the number of items currently contained in the list.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +None
> +
> +#### Result value
> +
> +The result is the number of items currently contained in the list.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_size.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `clear`
>
> ⬇️ Suggested change
>
> -### `clear`
> +### `clear` - Remove all items from the list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +The result is the number of items currently contained in the list.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_size.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `clear`
> +
> +#### Description
> +
> +Remove all items from the list
>
> ⬇️ Suggested change
>
> -Remove all items from the list
> +Remove all items from the list.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +Subroutine.
> +
> +#### Argument
> +
> +None
> +
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_clear.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `get`
>
> ⬇️ Suggested change
>
> -### `get`
> +### `get` - Get the data item at a given position in the list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +#### Syntax
> +
> +`item = [[stdlib_linked_list(module):list%get(interface)]] (node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Function.
> +
> +#### Argument
> +
> +- `node_index`: Position in the list for the new item (integer)
>
> ⬇️ Suggested change
>
> -- `node_index`: Position in the list for the new item (integer)
> +- `node_index`: Shall be a scalar integer equal to the position in the list for the new item.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Syntax
> +
> +`item = [[stdlib_linked_list(module):list%get(interface)]] (node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Function.
> +
> +#### Argument
> +
> +- `node_index`: Position in the list for the new item (integer)
> + This argument is intent(in).
>
> ⬇️ Suggested change
>
> - This argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Function.
> +
> +#### Argument
> +
> +- `node_index`: Position in the list for the new item (integer)
> + This argument is intent(in).
> +
> +#### Result value
> +
> +The data item (of type class(*)) that is stored at the given position.
>
> ⬇️ Suggested change
>
> -The data item (of type class(*)) that is stored at the given position.
> +The data item (of type `class(*)`) that is stored at the given position.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +The data item (of type class(*)) that is stored at the given position.
> +
> +Notes:
> +
> +- If the index is 0 or less, the first item in the list is returned.
> +- If the index is larger than the number of items, the last item in the list is returned.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_get.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `insert`
>
> ⬇️ Suggested change
>
> -### `insert`
> +### `insert` - Insert a new item at a given position in the list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%insert(interface)]] (item, node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `item`: Data item to be stored (any type).
> + This argument is intent(in).
>
> ⬇️ Suggested change
>
> - This argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +`call [[stdlib_linked_list(module):list%insert(interface)]] (item, node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `item`: Data item to be stored (any type).
> + This argument is intent(in).
> +- `node_index`: Position in the list for the new item (integer)
>
> ⬇️ Suggested change
>
> -- `node_index`: Position in the list for the new item (integer)
> +- `node_index`: Shall be a scalar integer equal to the position in the list for the new item.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +`call [[stdlib_linked_list(module):list%insert(interface)]] (item, node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `item`: Data item to be stored (any type).
> + This argument is intent(in).
> +- `node_index`: Position in the list for the new item (integer)
> + This argument is intent(in).
>
> ⬇️ Suggested change
>
> - This argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +The list is extended with the new data item at the given position.
> +
> +Notes:
> +
> +- If the index is 0 or less, the item is stored at the first position.
> +- If the index is larger than the number of items, it will be appended to the end of the list.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_insert.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `replace`
>
> ⬇️ Suggested change
>
> -### `replace`
> +### `replace` - Replace an existing data by a new item at a given position in the list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `item`: The new data item to be stored (any type).
>
> ⬇️ Suggested change
>
> -- `item`: The new data item to be stored (any type).
> +- `new_item`: The new data item to be stored (any type).
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `item`: The new data item to be stored (any type).
> + This argument is intent(in).
>
> ⬇️ Suggested change
>
> - This argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `item`: The new data item to be stored (any type).
> + This argument is intent(in).
> +- `node_index`: Position in the list for the item to be replaced (integer)
>
> ⬇️ Suggested change
>
> -- `node_index`: Position in the list for the item to be replaced (integer)
> +- `node_index`: Shall be a scalar integer equal to the position in the list for the item to be replaced.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `item`: The new data item to be stored (any type).
> + This argument is intent(in).
> +- `node_index`: Position in the list for the item to be replaced (integer)
> + This argument is intent(in).
>
> ⬇️ Suggested change
>
> - This argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +The new data item is stored and the existing one removed.
> +
> +Notes:
> +
> +- If the index is 0 or less, or it is larger than the number of items, nothing is done.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_replace.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `remove`
>
> ⬇️ Suggested change
>
> -### `remove`
> +### `remove` - Remove an items at a given position in the list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%remove(interface)]] (node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `node_index`: Position in the list for the item to be removed (integer)
>
> ⬇️ Suggested change
>
> -- `node_index`: Position in the list for the item to be removed (integer)
> +- `node_index`: Shall be a scalar integer equal to the position in the list for the item to be removed.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%remove(interface)]] (node_index)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `node_index`: Position in the list for the item to be removed (integer)
> + This argument is intent(in).
>
> ⬇️ Suggested change
>
> - This argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Result value
> +
> +The indicated item has been removed from the list.
> +
> +Notes:
> +
> +- If the index is 0 or less or the index is larger than the number of items, nothing is done.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_remove.f90!}
> +```
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `push`
>
> ⬇️ Suggested change
>
> -### `push`
> +### `push` - Append a new item to the end of the list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%push(interface)]] (item)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `item`: Data item to be stored (any type).
> + This argument is intent(in).
>
> ⬇️ Suggested change
>
> - This argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +- `item`: Data item to be stored (any type).
> + This argument is intent(in).
> +
> +#### Result value
> +
> +The list is extended with the new data item at the tail.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_push.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `pop`
>
> ⬇️ Suggested change
>
> -### `pop`
> +### `pop` - Remove the last item in the list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +None
> +
> +#### Result value
> +
> +The list item in the list is removed.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_pop.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `reverse`
>
> ⬇️ Suggested change
>
> -### `reverse`
> +### `reverse` - Reconstruct the list in reverse order
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +None
> +
> +#### Result value
> +
> +The list now contains the items in reverse order.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_reverse.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `concat`
>
> ⬇️ Suggested change
>
> -### `concat`
> +### `concat` - Concatenate a list to another list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%concat(interface)]] (list_to_concat)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
>
> ⬇️ Suggested change
>
> -- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
> +- `list_to_concat`: list whose data items are to be appended to the given `linked_list_type` derived type.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%concat(interface)]] (list_to_concat)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
> + this argument is intent(in).
>
> ⬇️ Suggested change
>
> - this argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
> + this argument is intent(in).
> +
> +#### Result value
> +
> +The given list is extended with the data items in the second list. The second list remains intact.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_concat.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `absorb`
>
> ⬇️ Suggested change
>
> -### `absorb`
> +### `absorb` - Absorb a list into another list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%absorb(interface)]] (list_to_concat)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
>
> ⬇️ Suggested change
>
> -- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
> +- `list_to_absorb`: list whose data items will be appended to the given `linked_list_type` derived type.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Syntax
> +
> +`call [[stdlib_linked_list(module):list%absorb(interface)]] (list_to_concat)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
> + this argument is intent(inout).
>
> ⬇️ Suggested change
>
> - this argument is intent(inout).
> + This argument is `intent(inout)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
> + this argument is intent(inout).
> +
> +#### Result value
> +
> +The given list is extended with the data items in the second list. The second list is emptied.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_absorb.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `slice`
>
> ⬇️ Suggested change
>
> -### `slice`
> +### `slice` - Return a sublist of a list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +#### Syntax
> +
> +`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `start`: first item to store in the sublist (integer)
>
> ⬇️ Suggested change
>
> -- `start`: first item to store in the sublist (integer)
> +- `start`: Shall be a scalar integer equal to the first item to store in the sublist.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +
> +`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `start`: first item to store in the sublist (integer)
> + this argument is intent(in).
> +- `end`: last item to store in the sublist (integer)
>
> ⬇️ Suggested change
>
> -- `end`: last item to store in the sublist (integer)
> +- `end`: Shall be a scalar integer equal to the last item to store in the sublist.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +#### Syntax
> +
> +`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `start`: first item to store in the sublist (integer)
> + this argument is intent(in).
>
> ⬇️ Suggested change
>
> - this argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
> +
> +#### Status
> +
> +Experimental
> +
> +#### Class
> +
> +Subroutine.
> +
> +#### Argument
> +
> +- `start`: first item to store in the sublist (integer)
> + this argument is intent(in).
> +- `end`: last item to store in the sublist (integer)
> + this argument is intent(in).
>
> ⬇️ Suggested change
>
> - this argument is intent(in).
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > + this argument is intent(in).
> +
> +#### Result value
> +
> +Sublist consisting of the indicated data items. Note that the items themselves are copied from the original
> +list, so that the two lists are independent.
> +
> +#### Example
> +
> +```fortran
> +{!example/linked_list/example_slice.f90!}
> +```
> +
> +
> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
> +### `splice`
>
> ⬇️ Suggested change
>
> -### `splice`
> +### `splice` - Remove a sublist from a list
>
> ------------------------------
>
> In doc/specs/stdlib_linked_list.md
> <#680 (comment)>:
>
> > +- `start`: first item to be removed in the sublist (integer)
> + this argument is intent(in).
> +- `end`: last item to be removed in the sublist (integer)
> + this argument is intent(in).
>
> ⬇️ Suggested change
>
> -- `start`: first item to be removed in the sublist (integer)
> - this argument is intent(in).
> -- `end`: last item to be removed in the sublist (integer)
> - this argument is intent(in).
> +- `start`: Shall be a scalar integer equal to the first item to be removed in the sublist.
> + This argument is `intent(in)`.
> +- `end`: Shall be a scalar integer equal to the last item to be removed in the sublist.
> + This argument is `intent(in)`.
>
> ------------------------------
>
> In doc/specs/stdlib_stringlist.md
> <#680 (comment)>:
>
> > @@ -0,0 +1,487 @@
> +---
> +title: stringlist
> +---
> +# Lists of strings
>
> What is the difference with the stdlib stringlist_type
> <https://github.com/fortran-lang/stdlib/blob/master/doc/specs/stdlib_stringlist_type.md>
> ?
>
> —
> Reply to this email directly, view it on GitHub
> <#680 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAN6YRZKUF3L7TZYA6XNIGTYLIFLJAVCNFSM6AAAAAAQPNXWX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJVHE3DCNBYGY>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Two failures: on MSYS2 CMake was not found, on Ubuntu latest ifort was not
found.
How should we resolve these problems?
Op do 28 dec 2023 om 15:43 schreef Arjen Markus ***@***.***>:
… Just pushed the changes, but the fpm build is failing on the small
auxiliary include file I use in the examples. Quickest fix: include the
code rather than use an include file. Now let us see whether that worked.
Op do 28 dec 2023 om 14:36 schreef Arjen Markus ***@***.***
>:
> Thanks for the comments - I wil incorporate them in the documentation and
> the source code. Note: I have been developing a more thorough test program
> and found a few bugs, so these need to be repaired.
>
> Linked lists are more general than the stringlist_type. I see the branch
> has a misleading name. I will rename it, as it concerns the general list
> type only.
>
> Op di 26 dec 2023 om 00:41 schreef Jeremie Vandenplas <
> ***@***.***>:
>
>> ***@***.**** commented on this pull request.
>>
>> Thank you for this progress @arjenmarkus
>> <https://github.com/arjenmarkus> . Here are some suggestions.
>> Note that we use the suffix _type for derived types in stdlib.
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +# The `stdlib_linked_list` module
>> +
>> +[TOC]
>> +
>> +## Introduction
>> +
>> +The `stdlib_linked_list` module defines a class and its interface to handle linked lists that
>> +store any type of data. The list may contain data of the same type or of various types.
>> +
>> +
>> +## Types
>> +
>> +### `type(linked_list)`
>> +
>> +Linked lists are variables of the type `linked_list`. The type provides all the methods
>>
>> Types in stdlib should have the suffix _type in stdlib (see e.g.,
>> bitset_type, logger_type).
>> ⬇️ Suggested change
>>
>> -Linked lists are variables of the type `linked_list`. The type provides all the methods
>> +Linked lists are variables of the derived type `linked_list_type`. The derived type provides all the methods
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +title: linked lists
>> +---
>> +
>> +# The `stdlib_linked_list` module
>> +
>> +[TOC]
>> +
>> +## Introduction
>> +
>> +The `stdlib_linked_list` module defines a class and its interface to handle linked lists that
>> +store any type of data. The list may contain data of the same type or of various types.
>> +
>> +
>> +## Types
>> +
>> +### `type(linked_list)`
>>
>> ⬇️ Suggested change
>>
>> -### `type(linked_list)`
>> +### The `linked_list_type` derived type
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +store any type of data. The list may contain data of the same type or of various types.
>> +
>> +
>> +## Types
>> +
>> +### `type(linked_list)`
>> +
>> +Linked lists are variables of the type `linked_list`. The type provides all the methods
>> +required for storing and retrieving data.
>> +
>> +
>> +## Procedures and methods provided
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `size`
>>
>> ⬇️ Suggested change
>>
>> -### `size`
>> +### `size` - Return the number of data items in the list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Pure function.
>> +
>> +#### Argument
>> +
>> +None
>> +
>> +#### Result value
>> +
>> +The result is the number of items currently contained in the list.
>>
>> ⬇️ Suggested change
>>
>> -The result is the number of items currently contained in the list.
>> +The result is an integer scalar, equal to the number of items currently contained in the list.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +None
>> +
>> +#### Result value
>> +
>> +The result is the number of items currently contained in the list.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_size.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `clear`
>>
>> ⬇️ Suggested change
>>
>> -### `clear`
>> +### `clear` - Remove all items from the list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +The result is the number of items currently contained in the list.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_size.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `clear`
>> +
>> +#### Description
>> +
>> +Remove all items from the list
>>
>> ⬇️ Suggested change
>>
>> -Remove all items from the list
>> +Remove all items from the list.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +Subroutine.
>> +
>> +#### Argument
>> +
>> +None
>> +
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_clear.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `get`
>>
>> ⬇️ Suggested change
>>
>> -### `get`
>> +### `get` - Get the data item at a given position in the list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +#### Syntax
>> +
>> +`item = [[stdlib_linked_list(module):list%get(interface)]] (node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Function.
>> +
>> +#### Argument
>> +
>> +- `node_index`: Position in the list for the new item (integer)
>>
>> ⬇️ Suggested change
>>
>> -- `node_index`: Position in the list for the new item (integer)
>> +- `node_index`: Shall be a scalar integer equal to the position in the list for the new item.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Syntax
>> +
>> +`item = [[stdlib_linked_list(module):list%get(interface)]] (node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Function.
>> +
>> +#### Argument
>> +
>> +- `node_index`: Position in the list for the new item (integer)
>> + This argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - This argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Function.
>> +
>> +#### Argument
>> +
>> +- `node_index`: Position in the list for the new item (integer)
>> + This argument is intent(in).
>> +
>> +#### Result value
>> +
>> +The data item (of type class(*)) that is stored at the given position.
>>
>> ⬇️ Suggested change
>>
>> -The data item (of type class(*)) that is stored at the given position.
>> +The data item (of type `class(*)`) that is stored at the given position.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +The data item (of type class(*)) that is stored at the given position.
>> +
>> +Notes:
>> +
>> +- If the index is 0 or less, the first item in the list is returned.
>> +- If the index is larger than the number of items, the last item in the list is returned.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_get.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `insert`
>>
>> ⬇️ Suggested change
>>
>> -### `insert`
>> +### `insert` - Insert a new item at a given position in the list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%insert(interface)]] (item, node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `item`: Data item to be stored (any type).
>> + This argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - This argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +`call [[stdlib_linked_list(module):list%insert(interface)]] (item, node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `item`: Data item to be stored (any type).
>> + This argument is intent(in).
>> +- `node_index`: Position in the list for the new item (integer)
>>
>> ⬇️ Suggested change
>>
>> -- `node_index`: Position in the list for the new item (integer)
>> +- `node_index`: Shall be a scalar integer equal to the position in the list for the new item.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +`call [[stdlib_linked_list(module):list%insert(interface)]] (item, node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `item`: Data item to be stored (any type).
>> + This argument is intent(in).
>> +- `node_index`: Position in the list for the new item (integer)
>> + This argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - This argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +The list is extended with the new data item at the given position.
>> +
>> +Notes:
>> +
>> +- If the index is 0 or less, the item is stored at the first position.
>> +- If the index is larger than the number of items, it will be appended to the end of the list.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_insert.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `replace`
>>
>> ⬇️ Suggested change
>>
>> -### `replace`
>> +### `replace` - Replace an existing data by a new item at a given position in the list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `item`: The new data item to be stored (any type).
>>
>> ⬇️ Suggested change
>>
>> -- `item`: The new data item to be stored (any type).
>> +- `new_item`: The new data item to be stored (any type).
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `item`: The new data item to be stored (any type).
>> + This argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - This argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `item`: The new data item to be stored (any type).
>> + This argument is intent(in).
>> +- `node_index`: Position in the list for the item to be replaced (integer)
>>
>> ⬇️ Suggested change
>>
>> -- `node_index`: Position in the list for the item to be replaced (integer)
>> +- `node_index`: Shall be a scalar integer equal to the position in the list for the item to be replaced.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +`call [[stdlib_linked_list(module):list%insert(interface)]] (new_item, node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `item`: The new data item to be stored (any type).
>> + This argument is intent(in).
>> +- `node_index`: Position in the list for the item to be replaced (integer)
>> + This argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - This argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +The new data item is stored and the existing one removed.
>> +
>> +Notes:
>> +
>> +- If the index is 0 or less, or it is larger than the number of items, nothing is done.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_replace.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `remove`
>>
>> ⬇️ Suggested change
>>
>> -### `remove`
>> +### `remove` - Remove an items at a given position in the list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%remove(interface)]] (node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `node_index`: Position in the list for the item to be removed (integer)
>>
>> ⬇️ Suggested change
>>
>> -- `node_index`: Position in the list for the item to be removed (integer)
>> +- `node_index`: Shall be a scalar integer equal to the position in the list for the item to be removed.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%remove(interface)]] (node_index)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `node_index`: Position in the list for the item to be removed (integer)
>> + This argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - This argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Result value
>> +
>> +The indicated item has been removed from the list.
>> +
>> +Notes:
>> +
>> +- If the index is 0 or less or the index is larger than the number of items, nothing is done.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_remove.f90!}
>> +```
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `push`
>>
>> ⬇️ Suggested change
>>
>> -### `push`
>> +### `push` - Append a new item to the end of the list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%push(interface)]] (item)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `item`: Data item to be stored (any type).
>> + This argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - This argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +- `item`: Data item to be stored (any type).
>> + This argument is intent(in).
>> +
>> +#### Result value
>> +
>> +The list is extended with the new data item at the tail.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_push.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `pop`
>>
>> ⬇️ Suggested change
>>
>> -### `pop`
>> +### `pop` - Remove the last item in the list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +None
>> +
>> +#### Result value
>> +
>> +The list item in the list is removed.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_pop.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `reverse`
>>
>> ⬇️ Suggested change
>>
>> -### `reverse`
>> +### `reverse` - Reconstruct the list in reverse order
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +None
>> +
>> +#### Result value
>> +
>> +The list now contains the items in reverse order.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_reverse.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `concat`
>>
>> ⬇️ Suggested change
>>
>> -### `concat`
>> +### `concat` - Concatenate a list to another list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%concat(interface)]] (list_to_concat)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
>>
>> ⬇️ Suggested change
>>
>> -- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
>> +- `list_to_concat`: list whose data items are to be appended to the given `linked_list_type` derived type.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%concat(interface)]] (list_to_concat)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
>> + this argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - this argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +- `list_to_concat`: list whose data items are to be appended to the given list (type(linked_list)
>> + this argument is intent(in).
>> +
>> +#### Result value
>> +
>> +The given list is extended with the data items in the second list. The second list remains intact.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_concat.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `absorb`
>>
>> ⬇️ Suggested change
>>
>> -### `absorb`
>> +### `absorb` - Absorb a list into another list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%absorb(interface)]] (list_to_concat)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
>>
>> ⬇️ Suggested change
>>
>> -- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
>> +- `list_to_absorb`: list whose data items will be appended to the given `linked_list_type` derived type.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Syntax
>> +
>> +`call [[stdlib_linked_list(module):list%absorb(interface)]] (list_to_concat)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
>> + this argument is intent(inout).
>>
>> ⬇️ Suggested change
>>
>> - this argument is intent(inout).
>> + This argument is `intent(inout)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +- `list_to_absorb`: list whose data items will be appended to the given list (type(linked_list)
>> + this argument is intent(inout).
>> +
>> +#### Result value
>> +
>> +The given list is extended with the data items in the second list. The second list is emptied.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_absorb.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `slice`
>>
>> ⬇️ Suggested change
>>
>> -### `slice`
>> +### `slice` - Return a sublist of a list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +#### Syntax
>> +
>> +`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `start`: first item to store in the sublist (integer)
>>
>> ⬇️ Suggested change
>>
>> -- `start`: first item to store in the sublist (integer)
>> +- `start`: Shall be a scalar integer equal to the first item to store in the sublist.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +
>> +`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `start`: first item to store in the sublist (integer)
>> + this argument is intent(in).
>> +- `end`: last item to store in the sublist (integer)
>>
>> ⬇️ Suggested change
>>
>> -- `end`: last item to store in the sublist (integer)
>> +- `end`: Shall be a scalar integer equal to the last item to store in the sublist.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +#### Syntax
>> +
>> +`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `start`: first item to store in the sublist (integer)
>> + this argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - this argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +`sublist = [[stdlib_linked_list(module):list%slice(interface)]] (start, end)`
>> +
>> +#### Status
>> +
>> +Experimental
>> +
>> +#### Class
>> +
>> +Subroutine.
>> +
>> +#### Argument
>> +
>> +- `start`: first item to store in the sublist (integer)
>> + this argument is intent(in).
>> +- `end`: last item to store in the sublist (integer)
>> + this argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> - this argument is intent(in).
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > + this argument is intent(in).
>> +
>> +#### Result value
>> +
>> +Sublist consisting of the indicated data items. Note that the items themselves are copied from the original
>> +list, so that the two lists are independent.
>> +
>> +#### Example
>> +
>> +```fortran
>> +{!example/linked_list/example_slice.f90!}
>> +```
>> +
>> +
>> +<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
>> +### `splice`
>>
>> ⬇️ Suggested change
>>
>> -### `splice`
>> +### `splice` - Remove a sublist from a list
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_linked_list.md
>> <#680 (comment)>
>> :
>>
>> > +- `start`: first item to be removed in the sublist (integer)
>> + this argument is intent(in).
>> +- `end`: last item to be removed in the sublist (integer)
>> + this argument is intent(in).
>>
>> ⬇️ Suggested change
>>
>> -- `start`: first item to be removed in the sublist (integer)
>> - this argument is intent(in).
>> -- `end`: last item to be removed in the sublist (integer)
>> - this argument is intent(in).
>> +- `start`: Shall be a scalar integer equal to the first item to be removed in the sublist.
>> + This argument is `intent(in)`.
>> +- `end`: Shall be a scalar integer equal to the last item to be removed in the sublist.
>> + This argument is `intent(in)`.
>>
>> ------------------------------
>>
>> In doc/specs/stdlib_stringlist.md
>> <#680 (comment)>
>> :
>>
>> > @@ -0,0 +1,487 @@
>> +---
>> +title: stringlist
>> +---
>> +# Lists of strings
>>
>> What is the difference with the stdlib stringlist_type
>> <https://github.com/fortran-lang/stdlib/blob/master/doc/specs/stdlib_stringlist_type.md>
>> ?
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#680 (review)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AAN6YRZKUF3L7TZYA6XNIGTYLIFLJAVCNFSM6AAAAAAQPNXWX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJVHE3DCNBYGY>
>> .
>> You are receiving this because you were mentioned.Message ID:
>> ***@***.***>
>>
>
|
Such issues should have been solved with one of the latest PR. The CI seem to be ok now. |
module procedure stringlist_index_subtract | ||
end interface | ||
|
||
type string_type |
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.
could the string_type
present in stdlib_string_type
be used instead of redefining a new one?
Yes, it entered the repository by mistake :).
Op di 20 sep 2022 om 20:57 schreef Jeremie Vandenplas <
***@***.***>:
… ***@***.**** commented on this pull request.
------------------------------
In example/linked_list/mk.bat
<#680 (comment)>:
> @@ -0,0 +1,17 @@
+gfortran -c ../../src/stdlib_child_list.f90
I guess that this file should be removed from the directory.
—
Reply to this email directly, view it on GitHub
<#680 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YR4U2DCX3OPHMPQQLM3V7ICJVANCNFSM6AAAAAAQPNXWXY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I will have a look - unlikely to be a problem :).
Op vr 29 dec 2023 om 21:22 schreef Jeremie Vandenplas <
***@***.***>:
… ***@***.**** commented on this pull request.
------------------------------
In src/stdlib_stringlist.f90
<#680 (comment)>:
> + integer :: offset
+ end type stringlist_index_type
+
+ type(stringlist_index_type), parameter :: list_head = stringlist_index_type( .true., 1 )
+ type(stringlist_index_type), parameter :: list_end = stringlist_index_type( .false., 0 )
+ type(stringlist_index_type), parameter :: list_after_end = stringlist_index_type( .false., 1 )
+
+ interface operator(+)
+ module procedure stringlist_index_add
+ end interface
+
+ interface operator(-)
+ module procedure stringlist_index_subtract
+ end interface
+
+ type string_type
could the string_type present in stdlib_string_type be used instead of
redefining a new one?
—
Reply to this email directly, view it on GitHub
<#680 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YR2MDHVO3KBRJGHEXYLYL4RAJAVCNFSM6AAAAAAQPNXWX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJZGIYDIOBUG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
No description provided.