Feature suggestions

From Reia

Jump to: navigation, search
Contents: Top - 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Have a favorite feature in Python, Ruby, Erlang, or your language du jour which you don't see in right now but would like? Feel free to add your suggestions below. Please, add them alphabetically:

D

Decorator syntax

Python has this syntax:

 @decorator
 def myfunc():
   # do something

It's a functional construct that takes the decorated function as the main argument and produces a new function. Decorators can be chained and can also take parameters:

 @decorator1
 @decorator2(param1, param2)
 @decorator3(param1)
 def myfunc(param1, param2):
   #do something


Default parameter values

Some syntax ideas:

 def myfunc((~foo, _) = bar : 42)

Documentation

Documentation could be written in one of several formats, like Markdown, Textile or reStructuredText.

Documentation as first class language construction should be similar to Python's docstrings:

 >>> def foo(bar):
 ...   """
 ...   Accepts bar and returns bar * 2
 ...   """
 ...   return bar * 2
 ... 
 >>> foo(5)
 10
 >>> print foo.__doc__
 
   Accepts bar and returns bar * 2
   

F

Final Variables

I mean 'final' sort of like Java, sort of like C/++ const. The Reia implementation would be a single-assignment variable name, Erlang style, allowing people to dial-in the amount of rebinding they prefer for their own code.

K

Keyword Arguments

Python supports keyword arguments as seen in other languages like Objective C. Keyword arguments are a pain point in Ruby and would be a useful inclusion into Reia.

Some syntax ideas:

 func(1, 2, val2: 3, val1: 4, val3: 5)
Personal tools