Issue Details (XML | Word | Printable)

Key: BOO-95
Type: Wish Wish
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Rodrigo B. de Oliveira
Reporter: Rodrigo B. de Oliveira
Votes: 4
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Boo

custom macro syntax

Created: 16/Aug/04 03:35 PM   Updated: 09/Dec/07 01:13 PM
Component/s: Compiler, Parser
Affects Version/s: None
Fix Version/s: 0.8.1

Time Tracking:
Not Specified


 Description  « Hide
Feature complete with code literals, splicing and the 'macro' macro.
macro performTransaction:
    args = performTransaction.Arguments
    return [|
        _transaction = $(args[0]).BeginTransaction()
        try:
            $(performTransaction.Block)
            _transaction.Commit()
        except:
            _transaction.Revert()
            raise
        ensure:
            _transaction.End()
    |]


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Alex Peake added a comment - 17/Apr/05 12:31 PM
Have you looked at the implementation in Nemerele?

Sorin Ionescu added a comment - 17/Apr/05 06:25 PM
Personally, I like the way macros are written now. While they are a
little harder to write, they are easier to read. Plus, the more
easier macros is to create, the more they will be abused. I've seen
C++ code that does not look like C++ anymore due to macro abuse.

dennis peterson added a comment - 01/Jun/05 03:37 PM
I don't think a feature should be harder than necessary, just to keep people from using it ...for a counterexample, look at Lisp (and Scheme), where macros are used almost as much as functions, and everything works out great.