Does not seem to handle my main use case however (transforming a schema entry in Rails to a list of symbols). Eg: Input: t.integer "Id" t.integer "Active" t.string "Email", null: false t.string "CryptedPassword", null: false t.datetime "created_at" t.datetime "updated_at" Example: :Id Output: :Id :Active :Email :CryptedPassword :created :updated
This is pretty neat. Since were asking for features: smarter date conversions. For instance on the input: '2015-04-24', and for example output: '26 April 2015'. The if another line has '2015-03-01' it would output '1 March 2015'. This seems like a somewhat difficult problem, but it'd be magical if it worked.
I filter underscores to dashes, because I want a C function like foo_bar to look like foo-bar in the Lisp dialect. The (void) argument list is handled as a special case.
I need to parse the arguments because the output part needs to know how many there are. Note how "func_n2" is generated, where the 2 comes from the argument count.
Comments (144) 66 threads
Earlier commentsDoes not seem to handle my main use case however (transforming a schema entry in Rails to a list of symbols).
Eg:
Input:
t.integer "Id"
t.integer "Active"
t.string "Email", null: false
t.string "CryptedPassword", null: false
t.datetime "created_at"
t.datetime "updated_at"
Example:
:Id
Output:
:Id
:Active
:Email
:CryptedPassword
:created
:updated
An example (converting C++ to C):
Also, is it open-source?I do it out of Vim. That is: first, select a range of text, then pipe it out:
Done. For example, when adding functions to TXR Lisp's library, I start with a declaration like: I pipe this through a script which will produce this: ("Intern a symbol called "foo" in the user_package, and register a two-argument function object with this symbol, hosted from the C function foo.")It's a little complicated:
I filter underscores to dashes, because I want a C function like foo_bar to look like foo-bar in the Lisp dialect. The (void) argument list is handled as a special case.I need to parse the arguments because the output part needs to know how many there are. Note how "func_n2" is generated, where the 2 comes from the argument count.
All comments shown.
Couldn't load more comments. Check your connection and try again.