-
Notifications
You must be signed in to change notification settings - Fork 5
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
"set" procedure not accepting input of parameter_list type #13
Comments
Hello Thierry, Can you explain in more detail what you would like to be able to do. It's not quite clear to me. |
Hello Neal. If I have 2 parameter_list(s), let's say read from JSONs, I am looking to add a type bound procedure to be able to do:
Should be relatively easy using recursion and the iterators already in library (?) I will try to give it a go. |
I think you should be able to do something like that already: type(parameter_list) :: p
type(parameter_list), pointer :: p1, p2
p1 => p%sublist('json 1')
p2 => p%sublist('json 2')
call parameters_from_json_stream(json1_unit, p1)
call parameters_from_json_stream(json2_unit, p2) Note the use of That said, if one had an existing parameter list pointer p1, it would be very useful to be able to make it a new sublist of a parameter list p. So something like this: call parameter_list_from_json_stream(json1_unit, p1)
...
call p%set_sublist('json 1', p1) I've wanted this myself on several occasions. It's not always convenient or possible to create the empty sublist first and then fill it. Is this what you are looking for? This would be very easy to add. |
Yes, creating a sublist and subsequently filling it would be a workaround. The use case I was thinking of is a hierarchy of list which mirrors that of class composition. A class would have a constructor using a plist as a unique argument, and a "to_plist()" serialization. I can easily modify "to_plist" to take a pre-allocated plist as additional argument. Thank you very much! |
I'm intrigued by your serialization use case. If you can, and when you feel ready, I'd like to hear more about it. |
... as a way of appending an existing list to another one, as a sublist. ... thank you for the library!
The text was updated successfully, but these errors were encountered: