[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: special forms, take two (was Re: A lua version of "amb")
- From: HyperHacker <hyperhacker@...>
- Date: Sun, 26 Feb 2012 16:13:19 -0700
On Sun, Feb 26, 2012 at 05:46, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Sun, Feb 26, 2012 at 6:16 AM, Jay Carlson <nop@nop.com> wrote:
>> But Unix programmers are allergic to backslash being used that way.
>> Even though my brain says "yes, lots of languages write lambda as
>> backslash" my eyes say "control character".
>
> So \\x(x+1) would read better? ;)
>
>> of describing what I had in mind: string indexing is a partial
>> function from strings to characters.
>
> There's also the Go approach, where iterating over a UTF-8 string
> returns 'runes' rather than the underlying bytes.
>
>> My favorite lombok-so-bad-it's-good trick is how their implicitly
>> typed Java "var s = new HashSet()" is syntactically legal.
>
> I abuse the helpfulness of Eclipse by writing the same and using the
> correct feature to quickly fill in the actual type.
>
>> optional static typing all of a sudden makes dynamic languages much
>> heavier
>
> The approach in Koneki is to encourage people to provide types in the
> @param tags.
>
> steve d.
>
Wouldn't a more Lua-like approach be to use a keyword "lambda" instead
of a symbol? I think my favourite syntax would be:
lambda x: x+1
but that might be difficult to parse, since x:x looks like a function
call, so maybe you'd need a double colon.
lambda x (x+1) -- has the same problem, but even moreso since x(x+1)
is actually a valid statement.
--
Sent from my toaster.