[racket] bracket conversion?

From: John Clements (clements at brinckerhoff.org)
Date: Tue Nov 20 18:09:05 EST 2012

On Nov 20, 2012, at 11:28 AM, Eric Tanter wrote:

> Thanks John, that's very helpful!
> 
> Any idea about a whole-file racketify in DrRacket?

That's a toughy. What you want is to be able to invert (read-syntax). It seems to me that such a thing should be possible in many of the racket languages, but I'm not aware of an implementation. 

Actually, thinking about it harder, I suppose you have the original string text of the file, as well, so that makes it a hugely easier; you just need a predicate on the (un-expanded) syntax objects that can tell you whether a syntax list should have square or round brackets. 

So, here's the $64K question: can you specify precisely which places need to be changed? If so, it sounds like this is do-able.

John



> 
> -- Éric
> 
> 
> On Nov 20, 2012, at 3:16 PM, John Clements wrote:
> 
>> 
>> On Nov 20, 2012, at 10:01 AM, Eric Tanter wrote:
>> 
>>> Hi,
>>> 
>>> I'm converting code written with only standard parentheses, introducing squared ones where appropriate.
>>> 
>>> This is obviously not very fun (I'm converting all of OOPLAI), and it would be great if there'd be a way to select an open paren and "convert" it so that the matching closing paren is changed automatically.
>>> 
>>> Is this feasible?
>>> 
>> 
>> I'm pretty sure Sam and I added this binding last year. C-c C-[ ? I think you can look it up in the keybindings.
>>> 
>> 
>> John
>> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4370 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20121120/1e5d1d2d/attachment.p7s>

Posted on the users mailing list.