| Author |
Message |
abs_zero

Joined: Oct 27, 2013 Posts: 1 Location: NYC
|
Posted: Mon Oct 28, 2013 12:08 am Post subject:
newbie: question about string output, when is type printed Subject description: Chuck String Output adds type in parenthesis when no comma is found |
 |
|
How come when you leave out comma concatenation, it prints out the type , but when you include the comma it doesn't?
Example:
<<< now / second, "seconds" >>>;
yields:
10906.540408 seconds
but removing the comma and just printing the expression:
<<< now / second >>>;
yields the following:
10964.996644 :(float)
it basically appends :(float) to the value output, but doesn't do it when there's a concatenation present.
note: i'm using miniaudicle for windows 7, but it's the same output in command line. |
|
|
Back to top
|
|
 |
Antimon

Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 373
G2 patch files: 100
|
Posted: Mon Oct 28, 2013 4:20 am Post subject:
Re: newbie: question about string output, when is type printed Subject description: Chuck String Output adds type in parenthesis when no comma is found |
 |
|
| abs_zero wrote: | How come when you leave out comma concatenation, it prints out the type , but when you include the comma it doesn't?
Example:
<<<now>>>;
yields:
10906.540408 seconds
but removing the comma and just printing the expression:
<<<now>>>;
yields the following:
10964.996644 :(float)
it basically appends :(float) to the value output, but doesn't do it when there's a concatenation present.
note: i'm using miniaudicle for windows 7, but it's the same output in command line. |
I guess it can be interesting to see the type of stuff you print out sometimes, so when you use <<< >>> with a single argument it will add the type to the printout. I think you can see this if you just print out a single string too (e.g. <<< "hello" >>>;). But the ChucK people felt that ChucKers will probably want to be able to format the printouts without type info too, so they left the type stuff out of the multiple arguments version of <<< >>>.
(Incidentally I think I just realised why I used to see a lot of (string) endings to my printouts - I used to concatenate using + so I used the single argument version, e.g. <<< "The number is: " + number >>>; ) _________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
|
Back to top
|
|
 |
|