-
Notifications
You must be signed in to change notification settings - Fork 242
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
[textfile] inconsistency: drops consecutive spaces when reading from disk #738
Comments
it's consistent with how Pd reads data into binbufs (e.g. how a patch-file is read). |
But do you see the problem? Is there a chance to change the behavior into not dropping consecutive spaces? |
Generally it's possible to escape Pd's special characters with a backslash, e.g. In the meantime: if you want to preserve a symbol as is, read/write it as a list of ASCII characters with |
Am 4. September 2019 19:10:37 MESZ schrieb EsGeh <notifications@github.com>:
But do you see the problem?
yes of course. sorry if this didn't come across.
From a practical side it appears as an inconsistency.
for "consistency" you need a reference system. i pointed out that i consider Pd's binbuf loader this reference and that i don't see any inconsistency.
Is there a chance to change the behavior into not dropping consecutive
spaces?
Are there good reasons not to?
Would it break something?
depends on how it is implemented.
naively outputting a string `a b` (with multiple spaces) as something else than two symbols `a` and `b` will most likely break things.
otoh, allowing [textfile] (or better: the binbuf save function) to escape spaces in symbols (when saving) should fix a couple of problems
|
pd version: 0.50.0
Problem: [textfile] obj drops spaces when reading a file.
Example:
(This patch tries to write and read a message containing 2 consecutive spaces to/from disk.)
Expected behaviour:
Hitting the 1. msg. box (sets the textfile and then writes the content to a temporary file) should output
(2 spaces between)).
Hitting the 2. msg. box reads from the temporary file and should output
(with 2 consecutive spaces between) too.
Actual behaviour:
Hitting 1. msg box behaves as expected and outputs:
(2 spaces between)).
Hitting 2. msg box outputs
with just 1 space between.
Why this is bad:
Consecutive spaces carry important information.
In many contexts in pd they are used to represent empty symbols. This might be a bit awkward, but works, since pd in most contexts is consistent in this.
For example, this patch creates a list of 3 elements, where the second one is an empty symbol.
One might want to write and read such lists to and from disks. With the current state of [textfile] (and probably also [text]), this wont work without additional hacks.
The text was updated successfully, but these errors were encountered: