bwerf's Blog

It's plukalicious
posts - 14, comments - 12, trackbacks - 0, articles - 0

Tuesday, January 15, 2008

Currently in Pluk i use  void(int) to denote the type of a lambda/method taking an int argument and returning nothing/void. This is a bit of a problem when defining a variable:

void(Int) x;

for example, is difficult to parse, both visually and practically, is it a function call statement followed by a typo, or a variable definition? This problem gets bigger when the type includes a templated part, or is a function type itself. So i decided to try wrapping types in [] when this is needed or helpful.

[void(Int)] x;

Int y;

[List<U>(List<T>, U,T)] converter;

and in the case of a function type that returns a function type

[void(String)](String) or with optionally [[void(String](String)] when needed.

 

posted @ 10:30 PM | Feedback (0)

1. blog.

2. .....

3. profit!

posted @ 8:46 PM | Feedback (0)