pure-data / pddp

Pure Data Documentation Project
9 stars 2 forks source link

append-help.pd for templates without field arguments ambiguous #209

Closed sebshader closed 4 months ago

sebshader commented 4 months ago

I'm finally learning a bit more about datastructures, in append-help it says 'If there are no field arguments or just one specified field, you can use a "set" message to set both the template and field.'

however it doesn't say how to do it with no field arguments/specified fields (are those the same thing?). using 'set' without a field name doesn't work, and it doesn't mention how to trigger an append without any fields ('bang' doesn't work..) I'm trying to add a 'struct' without x and y, only an 'array'

porres commented 4 months ago

however it doesn't say how to do it with no field arguments/specified fields (are those the same thing?).

I don't understand your issue and specially this part. The help example shows specifically how to do it with no field arguments (none are specified), and it works quite well, and it works the same if you have a template and a field specified.

You could upload a patch for me to check what you may be doing wrong and also to figure how the help file might be confusing

porres commented 4 months ago

it doesn't mention how to trigger an append without any fields ('bang' doesn't work..)

this is also confusing, what do you mean by triggering an [append]? And there is no 'bang' method, so it shouldn't work really.

sebshader commented 4 months ago

I mean I can append without y and only x, if my template only has an 'x' field. (the help file shows not setting y with the 'set append-template x' message afaict)

The help file does not show how to append without y or x, only with "x". However the text leads one to believe that it might be possible. Maybe the confusion lies in the difference between 'arguments' and 'specified fields'. In the help file a field is specified through the set message. Perhaps the text should make clear that if there are no arguments, one still must specify a field through the 'set' message. I'm interested in the case of append with no specified float fields. This is what the help file does not make clear about existing or not existing (now it seems like it doesn't exist..)

maybe the 'fix' is adding a 'bang' method to [append]..

porres commented 4 months ago

Oh, for me it's pretty obvious you need specified fields, and you also get clear errors if you don't have on the console, and the help file also tells you to first set the fields before doing anything. I'm failing to see how it could be improved actually, sorry

sebshader commented 4 months ago

the issue is the user is left wondering if it is possible to do.. user tries to do X and gets errors is a bad way to show that X isn't possible. In many situations something is possible but the user doesn't know exactly how to. Simply saying 'at least one float field must be used to trigger the append' or something would be helpful, but also the phrase 'no arguments or one specifier' doesn't clarify the situations that aren't 'no arguments, and one specifier in a set message'

I disagree that "If there are no field arguments or just one specified field" makes it obvious that there needs to be one specified field.

sebshader commented 4 months ago

I guess it does say there has to be a field name, but the way that interacts with 'there doesn't have to be arguments' was confusing Maybe it could be 'you can use this 'set' message to set the field if there is only one'

.. maybe I'll just open a PR to add a bang method though

porres commented 4 months ago

Simply saying 'at least one float field must be used to trigger the append' or something would be helpful

Besides all the errors you get and the clues I mentioned, help file also says:

"There should be at least one field name and each field name creates a corresponding inlet". I mean, there are general cues and I'm thinking on how to improve this a bit, but I just don't see a flaw...

I disagree that "If there are no field arguments or just one specified field" makes it obvious that there needs to be one specified field.

What about the "click on these messages first:" comment that I mentioned before?

porres commented 4 months ago

maybe I'll just open a PR to add a bang method though

why and what do you want a bang method for?

sebshader commented 4 months ago

maybe I'll just open a PR to add a bang method though

why and what do you want a bang method for?

.. my original desire to append data structures without needing to have unnecessary float fields in the template just to use [append]. I wanted to make a symbol array, which I ended up succeeding in through just sending the 'scalar' message to the subpatch (of course using [list store] is easier but why not have it be possible?)

porres commented 4 months ago

Ok, I don't get that, but it's clearly not a doc issue, you can open an issue for that and a PR in pd's repo. About this issue, have I made strong arguments that the help file and how the object operates seems clear?

sebshader commented 4 months ago

well I was confused so I guess I still think it's a slight docs issue. But I guess it can wait until/if I make a pr for a bang method (when the help file will have to be updated anyways)