stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

String list new

Open arjenmarkus opened this issue 3 years ago • 9 comments

arjenmarkus avatar Sep 18 '22 12:09 arjenmarkus

I think the fpm-deployment CI is failing because you need to update the ci/fpm-deployment.sh script to also copy over the included files into an ./include folder in the root directory.

LKedward avatar Sep 21 '22 05:09 LKedward

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.

arjenmarkus avatar Sep 25 '22 15:09 arjenmarkus

The test program was failing because it tried to read from the keyboard. Changed it to simply use a length of one million elements.

arjenmarkus avatar Sep 25 '22 15:09 arjenmarkus

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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436163563:

+# 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436163828:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164003:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164099:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164143:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164148:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164220:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164439:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164446:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164472:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164536:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164560:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164585:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164589:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164606:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164646:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164660:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164687:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164710:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164749:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164801:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164820:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164874:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164889:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164905:

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164979:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165039:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165128:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165138:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165148:

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165215:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165247:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165298:

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165373:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165667:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165721:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165736:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165910:

  • 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165978:

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436166279:

@@ -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 https://github.com/fortran-lang/stdlib/pull/680#pullrequestreview-1795961486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YRZKUF3L7TZYA6XNIGTYLIFLJAVCNFSM6AAAAAAQPNXWX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJVHE3DCNBYGY . You are receiving this because you were mentioned.Message ID: @.***>

arjenmarkus avatar Dec 28 '23 13:12 arjenmarkus

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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436163563:

+# 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436163828:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164003:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164099:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164143:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164148:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164220:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164439:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164446:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164472:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164536:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164560:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164585:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164589:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164606:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164646:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164660:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164687:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164710:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164749:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164801:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164820:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164874:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164889:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164905:

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164979:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165039:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165128:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165138:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165148:

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165215:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165247:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165298:

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165373:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165667:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165721:

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165736:

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165910:

  • 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165978:

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436166279:

@@ -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 https://github.com/fortran-lang/stdlib/pull/680#pullrequestreview-1795961486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YRZKUF3L7TZYA6XNIGTYLIFLJAVCNFSM6AAAAAAQPNXWX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJVHE3DCNBYGY . You are receiving this because you were mentioned.Message ID: @.***>

arjenmarkus avatar Dec 28 '23 14:12 arjenmarkus

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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436163563 :

+# 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436163828 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164003 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164099 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164143 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164148 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164220 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164439 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164446 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164472 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164536 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164560 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164585 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164589 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164606 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164646 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164660 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164687 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164710 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164749 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164801 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164820 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164874 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164889 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164905 :

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436164979 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165039 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165128 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165138 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165148 :

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165215 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165247 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165298 :

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165373 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165667 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165721 :

+#### 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165736 :

+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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165910 :

  • 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436165978 :

+- 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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1436166279 :

@@ -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 https://github.com/fortran-lang/stdlib/pull/680#pullrequestreview-1795961486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YRZKUF3L7TZYA6XNIGTYLIFLJAVCNFSM6AAAAAAQPNXWX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJVHE3DCNBYGY . You are receiving this because you were mentioned.Message ID: @.***>

arjenmarkus avatar Dec 28 '23 15:12 arjenmarkus

Two failures: on MSYS2 CMake was not found, on Ubuntu latest ifort was not found. How should we resolve these problems?

Such issues should have been solved with one of the latest PR. The CI seem to be ok now.

jvdp1 avatar Dec 29 '23 18:12 jvdp1

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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r975713304:

@@ -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 https://github.com/fortran-lang/stdlib/pull/680#pullrequestreview-1114329847, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YR4U2DCX3OPHMPQQLM3V7ICJVANCNFSM6AAAAAAQPNXWXY . You are receiving this because you authored the thread.Message ID: @.***>

arjenmarkus avatar Jan 02 '24 10:01 arjenmarkus

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 https://github.com/fortran-lang/stdlib/pull/680#discussion_r1438400651:

  •    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 https://github.com/fortran-lang/stdlib/pull/680#pullrequestreview-1799204847, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YR2MDHVO3KBRJGHEXYLYL4RAJAVCNFSM6AAAAAAQPNXWX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJZGIYDIOBUG4 . You are receiving this because you were mentioned.Message ID: @.***>

arjenmarkus avatar Jan 02 '24 10:01 arjenmarkus