On Monday 17 November 2008 16:26:53 Jose A. Ortega Ruiz wrote:

> Yes... except maybe when there're words before the opening brace?:
>
>      a swap {
>              10
>              20
>      } ! <- here (like C)
>             } ! <- or here?
>
> Similar problems seem to exist for multiline []... What would be the
> correct indentation?

Here are some example that I think are correct:

: abc ( -- seq )
    {
        10
        20
        30
    } ;

: xyz ( -- ? )
    hij dup blah? [
        def
        ...
    ] [
        lmn
        ...
    ] if ;

! Alternative style:

: xyz ( -- ? )
    hij dup blah?
    [
        def
        ...
    ]
    [
        lmn
        ...
    ]
    if ;

So yeah, like you said; if there are words before the opening brace/bracket 
then it should do the 'C style' thing. If it's on it's own line such as in 
the second 'xyz', then the opening and closing braces/brackets should line up 
vertically.

If you see conflicting styles in the Factor distribution, go with the style in 
the vocabularies authored by Slava.

Ed

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to