Re: [PD-dev] strings

2006-12-19 Thread Tim Blechmann
On Mon, 2006-12-18 at 12:46 -0500, Mathieu Bouchard wrote: of course the only real way to vote for this would be write the code - i think i'll wait for PNPD instead.. :) pnpd is currently supporting both hashed symbols and full-featured string ;) however, there are no objects for

Re: [PD-dev] strings

2006-12-18 Thread Tim Blechmann
of course the only real way to vote for this would be write the code - i think i'll wait for PNPD instead.. :) pnpd is currently supporting both hashed symbols and full-featured string ;) however, there are no objects for handling strings, yet t -- [EMAIL PROTECTED]ICQ: 96771783

Re: [PD-dev] strings

2006-12-18 Thread Mathieu Bouchard
On Sun, 17 Dec 2006, Martin Peach wrote: but in the long term it would be best to just use long lengths for when we all have teraflop laptops: People have been using strings bigger than 64k for many years in almost any other language. It doesn't have anything to do with the teraflops,

Re: [PD-dev] strings

2006-12-18 Thread Mathieu Bouchard
On Mon, 18 Dec 2006, Hans-Christoph Steiner wrote: On Dec 17, 2006, at 1:36 AM, Mathieu Bouchard wrote: That's aiming low. Why shouldn't there be any automatic casts between the two? Automatic type conversion sounds like a really bad idea if the language only partially supports it. If

Re: [PD-dev] strings

2006-12-18 Thread Hans-Christoph Steiner
On Dec 18, 2006, at 1:23 AM, carmen wrote: Automatic type conversion sounds like a really bad idea if the language only partially supports it. Pd is strongly typed is it? it mainly has numbers that occasionally look like symbols, and symbols that more than occasionally look like lists

Re: Re: [PD-dev] strings

2006-12-18 Thread Mathieu Bouchard
On Mon, 18 Dec 2006, [EMAIL PROTECTED] wrote: Mathieu Bouchard [EMAIL PROTECTED] wrote: I have no clue what you're talking about: how mangled would they be? i don't plan any mangling to happen, except for the presence of \0 characters. Maybe you don't understand what is being proposed. How

Re: Re: [PD-dev] strings

2006-12-18 Thread Mathieu Bouchard
On Mon, 18 Dec 2006, [EMAIL PROTECTED] wrote: If ascii values from 0 - 31 can be part of symbols that would be nice. How do you specify a symbol containing ascii values 1 2 and 3? Do they have names? Do it the way most languages have borrowed from C : use backslash followed by an octal or

Re: Re: [PD-dev] strings

2006-12-18 Thread martin.peach
Mathieu Bouchard [EMAIL PROTECTED] wrote: Do you realise that the quoting problem can be solved independently of the allocation problem? In that case, you would be able to save any symbol and read it back. This would solve the problem about CR LF and spaces; only the problem with \0

Re: Re: [PD-dev] strings

2006-12-18 Thread martin.peach
De: Hans-Christoph Steiner [EMAIL PROTECTED] Date: 2006/12/18 lun. AM 09:45:26 GMT-05:00 À: carmen [EMAIL PROTECTED] Cc: pd-dev@iem.at Objet: Re: [PD-dev] strings On Dec 18, 2006, at 1:23 AM, carmen wrote: Automatic type conversion sounds like a really bad idea if the language

Re: Re: [PD-dev] strings

2006-12-18 Thread martin.peach
De: Mathieu Bouchard [EMAIL PROTECTED] Date: 2006/12/18 lun. PM 12:11:18 GMT-05:00 À: Martin Peach [EMAIL PROTECTED] Cc: pd-dev@iem.at Objet: Re: [PD-dev] strings On Sun, 17 Dec 2006, Martin Peach wrote: You make them work as strings when they can, and You make them work

Re: [PD-dev] strings

2006-12-18 Thread Hans-Christoph Steiner
On Dec 18, 2006, at 12:42 PM, Mathieu Bouchard wrote: On Mon, 18 Dec 2006, Hans-Christoph Steiner wrote: On Dec 17, 2006, at 1:36 AM, Mathieu Bouchard wrote: That's aiming low. Why shouldn't there be any automatic casts between the two? Automatic type conversion sounds like a really bad

Re: [PD-dev] strings

2006-12-18 Thread Hans-Christoph Steiner
On Dec 18, 2006, at 12:42 PM, Mathieu Bouchard wrote: On Mon, 18 Dec 2006, Hans-Christoph Steiner wrote: On Dec 17, 2006, at 1:36 AM, Mathieu Bouchard wrote: That's aiming low. Why shouldn't there be any automatic casts between the two? Automatic type conversion sounds like a really bad

Re: [PD-dev] strings

2006-12-18 Thread Mathieu Bouchard
On Mon, 18 Dec 2006, Hans-Christoph Steiner wrote: On Dec 18, 2006, at 12:42 PM, Mathieu Bouchard wrote: Non-sequitur, there are languages that have quite strict and elaborate type checking and yet which support implicit casts. For example, C++. C/C++ is not very strict. It allows you to

Re: [PD-dev] strings

2006-12-17 Thread Bryan Jurish
On 2006-12-17 03:09:19, Martin Peach [EMAIL PROTECTED] appears to have written: A string could be considered unused when its length is set to 0. Memory would need to be dynamically allocated in small blocks. The API should return no method for string if the external doesn't implement strings.

Re: [PD-dev] strings

2006-12-17 Thread Mathieu Bouchard
On Sun, 17 Dec 2006, Bryan Jurish wrote: ... which wouldn't get us true strings in the mathematical sense of a free monoid Alphabet,concat(), since the empty string is the identity element for concat()... Right, and it may seem like not much, but if one is going to make a lot of

Re: [PD-dev] strings

2006-12-17 Thread Martin Peach
Mathieu Bouchard wrote: On Sat, 16 Dec 2006, Martin Peach wrote: What if strings could be automatically cast to symbols for externals that would rather have symbols, and vice-versa? I have written an external asc2sym that takes lists of bytes and splits them into symbols based on the

Re: [PD-dev] strings

2006-12-17 Thread Martin Peach
Mathieu Bouchard wrote: On Sat, 16 Dec 2006, Martin Peach wrote: Yes, and it's also easier to limit strings to word (16-bit) lengths, while 8-bit is too short. So a t_string would look like: typedef struct _string /* pointer to a string */ { unsigned short s_length; /* length of string in

Re: [PD-dev] strings

2006-12-17 Thread Bryan Jurish
moin Martin, moin list, On 2006-12-17 21:46:50, Martin Peach [EMAIL PROTECTED] appears to have written: Bryan Jurish wrote: On 2006-12-17 03:09:19, Martin Peach [EMAIL PROTECTED] appears to have written: A string could be considered unused when its length is set to 0. Memory would need to be

Re: [PD-dev] strings

2006-12-17 Thread Hans-Christoph Steiner
On Dec 17, 2006, at 1:36 AM, Mathieu Bouchard wrote: On Sat, 16 Dec 2006, Martin Peach wrote: What if strings could be automatically cast to symbols for externals that would rather have symbols, and vice-versa? I have written an external asc2sym that takes lists of bytes and splits them

Re: [PD-dev] strings

2006-12-17 Thread carmen
Automatic type conversion sounds like a really bad idea if the language only partially supports it. Pd is strongly typed is it? it mainly has numbers that occasionally look like symbols, and symbols that more than occasionally look like lists and/or strings.. , so what Martin says is

Re: [PD-dev] strings

2006-12-17 Thread carmen
Automatic type conversion sounds like a really bad idea if the language only partially supports it. Pd is strongly typed do you think the target user base wants to think in terms of casting types? i don't. i have a feeling that was why there are so few types. i think most users wan't to be

Re: [PD-dev] strings

2006-12-16 Thread Mathieu Bouchard
On Sat, 16 Dec 2006, Bryan Jurish wrote: On 2006-12-16 01:40:03, Mathieu Bouchard [EMAIL PROTECTED] appears to have written: i count (sizeof(int)+sizeof(float)-1)*strlen(message) wasted bytes per string object, not counting the selector. Oh yeah, sorry, the occupied space is up to 4 times

Re: [PD-dev] strings

2006-12-16 Thread Hans-Christoph Steiner
On Dec 16, 2006, at 4:55 AM, Bryan Jurish wrote: morning, On 2006-12-16 01:40:03, Mathieu Bouchard [EMAIL PROTECTED] appears to have written: On Fri, 15 Dec 2006, Hans-Christoph Steiner wrote: An advantage using the list-of-bytes approach is that because each character can be represented

Re: [PD-dev] strings

2006-12-16 Thread Martin Peach
I think it would be most efficient to have a string type be a length followed by that many unsigned chars, similar to a Pascal string but with the length being something like a 32-bit integer. It would not be added to pd's symbol list. The atom whose type was string would have to contain a

Re: [PD-dev] strings

2006-12-16 Thread Mathieu Bouchard
On Sat, 16 Dec 2006, Martin Peach wrote: ...so a string atom would have a_type = A_STRING and a_w = a_w.w_string, which points to a t_string containing the length and a pointer to the string. If pd is otherwise able to handle atom types it doesn't know about (?), It's not. There are no

Re: [PD-dev] strings

2006-12-16 Thread Martin Peach
Hans-Christoph Steiner wrote: The one problem I can think of here is that you can only have 19 bits of precision in Pd's 32-bit t_float. So having a length of 32 bits would cause problems if trying to deal with string length using t_floats. I could see this happening in a loop in Pd space,

Re: [PD-dev] strings

2006-12-16 Thread Mathieu Bouchard
On Sat, 16 Dec 2006, Martin Peach wrote: Yes, and it's also easier to limit strings to word (16-bit) lengths, while 8-bit is too short. So a t_string would look like: typedef struct _string /* pointer to a string */ { unsigned short s_length; /* length of string in bytes */ unsigned char

Re: [PD-dev] strings

2006-12-16 Thread Mathieu Bouchard
On Sat, 16 Dec 2006, Martin Peach wrote: What if strings could be automatically cast to symbols for externals that would rather have symbols, and vice-versa? I have written an external asc2sym that takes lists of bytes and splits them into symbols based on the argument(s) which are characters.

Re: [PD-dev] strings

2006-12-15 Thread padawan12
Thanks Hans and IOhan, I think Bryans offering covers most of what is needed, adequate to muddle by until such time when we have real strings. Andy On Fri, 15 Dec 2006 17:41:03 -0500 Hans-Christoph Steiner [EMAIL PROTECTED] wrote: You can do a fair amount of string handling with

Re: [PD-dev] strings

2006-12-15 Thread Hans-Christoph Steiner
Plus you can use that string format directly with Martin Peach's network objects, AFAIK. .hc On Dec 16, 2006, at 7:16 AM, padawan12 wrote: Thanks Hans and IOhan, I think Bryans offering covers most of what is needed, adequate to muddle by until such time when we have real strings. Andy

Re: [PD-dev] strings

2006-12-15 Thread Mathieu Bouchard
On Fri, 15 Dec 2006, Hans-Christoph Steiner wrote: But yes, it leaves a lot to be desired. Bryan Jurish has taken a different approach, which is to use lists of bytes to represent strings. Might be worth checking out. An advantage using the list-of-bytes approach is that because each

[PD-dev] strings

2006-12-14 Thread padawan12
A new and keen developer on the forums has asked - What about text processing in Pd? to which I replied Pd doesn't do strings. I tie myself in knots trying string-like operations sometimes :), so I know its a can of worms, but what are the fundamental limitations surrounding symbol. How do we