rejetto forum

Macro changing?

rejetto · 46 · 17445

Poll

What markers do you prefer?

{.macro.} and {\quoting/}
1 (7.1%)
{:macro:} and {\quoting/}
4 (28.6%)
{\macro/} and {\\quoting//}
0 (0%)
{\macro/} and {/quoting\}
0 (0%)
{.macro.} and {:quoting:}
9 (64.3%)

Total Members Voted: 12

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
This topic is mainly for those of you who edit templates.
I have in mind 2 changes for the macros.

1. change {{ and }} to {. and .} or similar ...suggestions are welcome.
The point is readability. All those }}}}}} are very unclear and hard to count. While .}.}.}  is easier to know they are 3.

This is a 20 seconds job for me, but it will break compatibility with those of you who are already using a template with macros. It will cause some whining for few days.
I think it is worth it, and we must do it before I publish the stable version.

2. Having named parameters.
I mean, optionally you will specify parameters based on their names instead of their order.
Example {{substring|1|3|hey you}} will be equivalent to {{substring|what=hey you|from=1|to=3}}
In the later case the order is not important because you are naming the parameters.
What do we gain? Readability and memory, you can remember parameters' name instead of the order, sometimes it's easier.
I'm not even sure i can create this feature easily, but i want to know your opinion before.
« Last Edit: January 18, 2008, 05:23:45 AM by rejetto »


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
1.
Code: [Select]
change {{ and }} to {. and .} or similar ...this would be welcome!

2.
Code: [Select]
2. Having named parameters.could be very usefull, so we don'nt need no more to copy an rewrite notes from wiki changeing A|B|C|D| ... to string,expression,fromto ... perhaps you could first do this change in the wiki so we could propose alternate names if you choose some unhappy parametername.
your computer has no brain - use your own !


Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
1.
I like the idea for changing the surrounding markers because I have a lot of trouble reading some of the nested macro's I have created, and even more trouble when I find out I have missed closing one. {. and .} are a good suggestion and I'm in favor of those unless someone suggests a better more readable combination.

2.
This also sounds like a good idea and I think it could be useful for readability in some cases but the current way macro parameters work is fine in my opinion.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
1. what about {: and :} ? you like it more?


Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
{. and .} is still better because there is more white space so it stands out better.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
1. When we'll decide the new markers, you'll be able to convert your template by submitting it to www.rejetto.com/convert.php :)

2. I made a little test with named parameters, and they work. I will let you know as i decide name of parameters. You can suggest in the while.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
1. Moreover, i think {{\ and /}} should become {\ and /}
i don't think they should collide with other things


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
i'd like to hear from the rawr team about the legacy breaking
(although we're speaking of legacy with betas, no with officials)


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
I do not know if you will be of my opinion,but as rejetto I think that the shortest is the best

the advantage off {{ or }} is that you press the key ALT-GR + twice {

but {.  you must press ALT GR + {  and then SHIFT+. (when you have no numeric keyboard)

French keyboard is not more easy than us keyboard  where keys are not at same place.

Often I am obliged to concentrate on the keyboard for  not to confuse [[ and {{.

for {{\ ansd /}}  why not use {{\ and \}}   and then only 3 actions with keyboard

1 ALT-GR
2 \
3 {{ or }}

WHY ??

how making diffence by using  {{set|myvar|/set}}  ;    Is myvar empty or must it be "/set"?

the same problem is here to detect {{\   ...... /}} or  {{\   ....  \}}

I propose at this place  {\\    and //} to reduce usage {{ as will rejetto to use one { 

Quote
All those }}}}}} are very unclear and hard to count
you can add some caraters as space or /     :           /}}/}}/}}   easy to count.

A good example of that (http://www.rejetto.com/forum/index.php?topic=5353.msg1032379#msg1032379)

Quote
{{if|{{or|{{{{?p}}=1}}|{{not|{{?p}}}}}}||{{\{{for|B|1|{{sub|{{mul|{{^topic-limit}}|{{?p}}}}|25}}|{{\{{set|topic-order|{{cut|{{add|{{length|{{substring||;|{{^topic-order}}}}}}|2}}||{{^topic-order}}}}}}/}}/for}}/}}/if}}
converted to
Quote
{{if not|{{or|{{?p=1}}|{{?p=}} /or}}
           |{{\ 
                 {{for|B
                        |1
                        |{{sub|{{mul|{{^topic-limit}}| {{?p}} }} |25}}
                        |{{\
                             {{set|topic-order
                                    | {{cut|{{add|{{length|{{substring||;|{{^topic-order}} /substring}} /length}}|2 /add}}
                                             ||{{^topic-order}}}}
                                        /cut}}
                             /set}}
                         /}}
                  /for}}
            /}}
/if}}


Why not use something as php

<?HFS  {set |myvar | SOME } {if|myvar| Ok for Me| why not?}  ?>

Why not redefine syntax for macros
<?HFS  set myvar= SOME; if (myvar) {Ok for Me}  else  {why not?}  ?> ;D ;D ;D ;D
There, I joke naturally

The simplest is to preserve the existing, as a pebble in a shoe which hurts us in the foot, and to encourage rejetto to offer us a PHP version or cgi as fast as possible






there is no easy solution {{ {§  {[  {|  {$ {# {\ {: {&  the problem is how many keys you must press to obtain the min caracters in the template?  I prefer to save the end of my fingers ;D
Make your choice :D

Post scriptum:
{: is more visible as {.



« Last Edit: January 18, 2008, 02:56:03 PM by mars »


Offline Unknown8063

  • Occasional poster
  • *
    • Posts: 96
    • View Profile
I prefer {: and :}

Mars, PHP-esque syntax would be pretty slick, but I fear it's not practical for Rejetto to implement :(  Besides, true PHP support would be better :D


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
I'm all for readability,
I have my own thing in mind... [\macro/] I like this because you don't even have to press shift, its just 1 press for each symbol.

[\if | [\$section/] | [\$section/] /]

/]/]/] it's easy to see as well ;D

I also like this because its like \ / stands for importing a section, you could even remove $ and just have [\ /] for the section import so you end up with [section] [\section/]. This is just an idea for it though.

About legacy, I can just make the next build have the new macros and force an update, once i'm able to fire the {{load}} macro in [special:strings] i'll be able to release.

If it HAS to have the {} then i prefer {\ /}


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
Quote
I have my own thing in mind... [\macro/] I like this because you don't even have to press shift, its just 1 press for each symbol.

Look at the other countries, this is not true for the French keyboard for example


Quote
[\section/]
[\  /] or {\  /}  It returns to the same, so much to use [[ ]]   or {{ }}

******************************************************

for {{\    /}} I suggest, when it is possible, to do without it

to examples
{{set|myvar|{{one macro|some parametters}} }}
{{set|mymacro|{{\ {{one macro|some parametters}} /}}  }}

Replaceable by
{{set var | myvar | {{one macro|some parametters}} }}
{{set macro | mymacro | {{one macro|some parametters}}  }} no dequote necessary but working as it   ( set is not necessary to define var and macro)

And make a difference during the call
{{%myvar}}
{{^mymacro}}

And keep {{set|mymacro|  }} for a usage mixed as

{{set|mymacro | ... {{one macro|some parametters}} .... {{\ {{other macro|some parametters}} /}} ... }}





Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
It will be better with {\ /} or [\ /] cause it is more readable, your whole post achieves nothing towards a solution.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile

Quote
It will be better with {\ /} or [\ /] cause it is more readable

Everything depends from which point of view we take place and of how we write his code, proof is there:

Quote
Quote
{{if|{{or|{{{{?p}}=1}}|{{not|{{?p}}}}}}||{{\{{for|B|1|{{sub|{{mul|{{^topic-limit}}|{{?p}}}}|25}}|{{\{{set|topic-order|{{cut|{{add|{{length|{{substring||;|{{^topic-order}}}}}}|2}}||{{^topic-order}}}}}}/}}/for}}/}}/if}}

converted to

Quote
{{if not|{{or|{{?p=1}}|{{?p=}} /or}}
           |{{\ 
                 {{for|B
                        |1
                        |{{sub|{{mul|{{^topic-limit}}| {{?p}} }} |25}}
                        |{{\
                             {{set|topic-order
                                    | {{cut|{{add|{{length|{{substring||;|{{^topic-order}} /substring}} /length}}|2 /add}}
                                             ||{{^topic-order}}}}
                                        /cut}}
                             /set}}
                         /}}
                  /for}}
            /}}
/if}}



It is enough to take time to make things methodically ;D ;D ;D

If we look in depth at posts, we notice that nobody really brings solutions but only the preferences of each. ???
« Last Edit: January 19, 2008, 12:57:28 AM by mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
for {{\ ansd /}}  why not use {{\ and \}}   and then only 3 actions with keyboard
1 ALT-GR
2 \
3 {{ or }}
WHY ??

i proposed {\ and /} few posts above.

Quote
how making diffence by using  {{set|myvar|/set}}  ;    Is myvar empty or must it be "/set"?

"making difference"? it is empty, because /set is ignored, as stated in the wiki.

Quote
Quote
All those }}}}}} are very unclear and hard to count


you can add some caraters as space or /     :           /}}/}}/}}   easy to count.

space is ok, but it's not very strong, and it makes the string longer.
you cannot use "/" and type /}} because that is the quoting closer!!!
.}.}.} is plainer than the extra space, and shorter.

Quote
Why not use something as php
<?HFS  {set |myvar | SOME } {if|myvar| Ok for Me| why not?}  ?>

Because it's a longer syntax that would penalize quick usage.

Quote
there is no easy solution {{ {§  {[  {|  {$ {# {\ {: {&  the problem is how many keys you must press to obtain the min caracters in the template?  I prefer to save the end of my fingers ;D
Make your choice :D

that is not the only point.
You write only once, but read many.
You shouldn't be quicker at typing and slower at reading. That is a bad design principle.

Quote
Post scriptum:
{: is more visible as {.

In the end :)