<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3354" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Kas. wrote:</FONT></DIV>
<DIV>In that case I think I'd prefer something like;<BR><BR>//warning; concept,
doesn't actually run<BR>32 => Std.mtof =>
my_pitches_array.apnd;<BR><BR>I'd say that's not as intuitively "left to
right" as the current situation for appending a single number but much
better then the thing we now get if that number is the result of a chain of
calculations yet doesn't have a name.<BR><FONT face=Arial
size=2>...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Why not something like:</FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>32 =>
Std.mtof => my_pitches_array[];</FONT><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>I think the bracket notation is very standard
(i.e. people are used to it from many languages), and it seems to be less
confusing and fits the left-to-right reading order.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Just my one cent!</FONT></DIV>
<DIV><FONT face=Arial size=2>-- Rich</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT>
<DIV><BR></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=signal.automatique@gmail.com
href="mailto:signal.automatique@gmail.com">Kassen</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=chuck@lists.cs.princeton.edu
href="mailto:chuck@lists.cs.princeton.edu">ChucK Central Mailing List</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, July 22, 2008 11:41
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [chuck] 1.2.1.2 (dracula)
unleashed</DIV>
<DIV><BR></DIV>
<DIV dir=ltr>Martin Ahnelöv ;<BR>
<DIV class=gmail_quote>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><BR>
<DIV class=Ih2E3d>> - (added) dynamic, resizable
arrays<BR>> .size(
int ) resizes array; .size() returns current size()<BR>>
<< operator appends new
elements into array<BR><BR></DIV>Is this really right? are we doing
right-to-left assignment now?<BR></BLOCKQUOTE>
<DIV><BR>I think the idea is that a value is appended, which means (reading
left to right) it ends up on the right end of the array so it's easiest to
visualise it as "entering from the right". I could also imagine a ">>"
operator that would enter values at the beginning of the array, moving the
rest one step to the right. I like it for appending single numbers, so
far.<BR><BR>This seems in tune with the general "like you read it" philosophy
of ChucK;<BR><BR>32 => Std.motof => my_osc.freq;<BR><BR>is more readable
to me then the equivalent<BR>my_osc.freq( Std.mtof( 32)
);<BR><BR>However, now re run into the situation where if we'd like to
append a float we need to do this;<BR><BR>my_pitches_array << Std.mtof(
32);<BR><BR>Instead of sending the number into mtof like;<BR><BR>//warning;
non-valid!!!<BR></DIV></DIV>my_pitches_array << 32 =>
Std.mtof;<BR><BR>...which ChucK interprets as a attempt so send a array of
floats into mtof, which predictably fails (and I'm not sure I like it for
functions that do take arrays as their argument because the poor number looks
like it's being quartered but that's no great issue as such a operation would
be better with two lines anyway).<BR><BR>In practice this means that if we
have some chain of functions that calculates a number which we'd like to
append to a array (seems like a likely scenario to me) we need to do
this;<BR><BR>my_pitches_array << ( 32 => Std.mtof);<BR><BR>...that
one does work but I'd say it won't win any beauty awards in the "operate like
it looks" department since it looks a bit confusing to me.<BR><BR>In that case
I think I'd prefer something like;<BR><BR>//warning; concept, doesn't actually
run<BR>32 => Std.mtof => my_pitches_array.apnd;<BR><BR>I'd say that's
not as intuitively "left to right" as the current situation for
appending a single number but much better then the thing we now get if that
number is the result of a chain of calculations yet doesn't have a
name.<BR><BR>As I see it so far this new feature encourages either naming
variables or code that looks weird to me right now. I have no strong opinion
on any of this yet, I'll have to see how it works out in practice but these
are some of my thoughts on it so far. I do think "<<" is quite ChucKian
as a concept but I suspect it will lead to less-then-ChucKian results in
non-trivial contexts.<BR><BR>Yours,<BR>Kas.<BR></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>chuck mailing
list<BR>chuck@lists.cs.princeton.edu<BR>https://lists.cs.princeton.edu/mailman/listinfo/chuck<BR></BLOCKQUOTE></BODY></HTML>