[Swift-devel] Re: passing types and variables in swift

Michael Wilde wilde at mcs.anl.gov
Thu Oct 4 11:57:50 CDT 2007


I should add:

While we discuss a direction here, I think that Andrew could do what he 
needs to do by just coding a script with statements like below.  As I 
recall Tibi and others have been doing this man many previous cases.

To make it manageable, he (or we) could do a simple ad-hoc #include 
mechanism to separate his core code from such list-setting code.

Andrew, can you take this from here using that approach?

Mihael: I think that addresses your "just say no" comment: do 
experiments that defer language changes until we see how they would be 
used and how best to couch them in the language.

- Mike



On 10/4/07 11:50 AM, Michael Wilde wrote:
> the extractcsv function sounds a bit like the value-setting mechanism i 
> proposed when you started on extractint: set many values from one file.
> 
> is one way to do this to 'eval' a file containing swift expressions?
> Or, to #include them?
> This would look like a keyword-based value file
> 
> myparms.rho[0]=0.1 mparms.theta[0]=0.2
> myparms.rho[1]=0.4 mparms.theta[0]=0.8
> ...
> myparms.rho[N-1]=0.etc mparms.theta[etc]=0.etc
> 
> even if not as clean as extractcsv, it might be both fast and useful for 
> many other purposes.
> 
> - mike
> 
> 
> 
> On 10/4/07 11:38 AM, Mihael Hategan wrote:
>> These hacks will bite us in the future.
>>
>> On Thu, 2007-10-04 at 15:46 +0000, Ben Clifford wrote:
>>> i'd be inclined to grab the csv reading code from the csv mapper and 
>>> see about making a @extractcsv function. It keeps code using it a 
>>> little bit more like it would if mappers could support it, which is 
>>> probably the way things will end up one day.
>>>
>>> On Thu, 4 Oct 2007, Michael Wilde wrote:
>>>
>>>> a hacky way to do this is first a loop to read the csv file into an 
>>>> array,
>>>> then do a foreach over the array.
>>>>
>>>> i suspect we have the constructs (with @extractint) to do this; not 
>>>> sure if we
>>>> can read the CSV into an array-of-structs that we can then foreach() 
>>>> over. But
>>>> even if not, this will work using parallel arrays, and probably not 
>>>> be too
>>>> unpleasing.
>>>>
>>>> lets try it.
>>>>
>>>> On 10/4/07 10:15 AM, Ben Clifford wrote:
>>>>> you're the second person today to talk about reading in values from 
>>>>> csv
>>>>> files. maybe we should implement this.
>>>>
>>> _______________________________________________
>>> Swift-devel mailing list
>>> Swift-devel at ci.uchicago.edu
>>> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
>>>
>>
>>
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> 
> 



More information about the Swift-devel mailing list