[swift-dev] How do I start implementing a feature?

Daryle Walker darylew at mac.com
Tue Aug 22 00:24:06 CDT 2017


> On Aug 21, 2017, at 3:55 PM, David Zarzycki <zarzycki at icloud.com> wrote:
> 
> The easiest way to start adding new features to an existing project is by cribbing from existing features that are sufficiently similar (at least enough to get started and see what fails to compile after some changes). For example, if you wanted to implement a new and awesome loop construct, then start by copying, pasting, and renaming the implementation details for an existing loop that you like (be it “for” or “while”, etc). You’ll learn far faster this way than any other way. :-)

I’m trying to figure out where are these features and what directories I need to look at.

The steps I would go are:
1. Create a new test file for the AST phase with “alter MyAlterTest1 {}”. Figure out where the corresponding makefile/whatever is and add the test file there too. Test and instantly fail, until I do:
2. Copy whichever files handle raw-value enumerations for the “similar existing feature” and alter them to until I get an AST match.
3. ???
4. Profit?

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 



More information about the swift-dev mailing list