|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid Win7 v1 <voi### [at] devnull> wrote:
> It's
> just not quite so easy to demo now. :-{
we should all be programming in javascript anyway...
> if your source code is 85% braces, anything short of
> colour-coding every single brace with a unique colour is pretty unreadable.
that's crazy. It's a great aid for editing, but other than that Lispers see it
as whitespace. That's why they don't match visually ) to the respective (, just
clutter all of them together at the end of an expression))). One usually opens
a pair with a single keystroke and then is put inside it to begin writing. A
Lisper really doesn't manually deals with them.
editors usually shade the whole region in gray
> OK. So eval actually goes slower. I was half expecting the entire
> compiler to be included at run-time. (Mind you, for something as simple
> as Lisp, maybe it's not that hard...)
some indeed have compile along with eval
>
> But the main idea
> is quite beautiful.
yes, Hindley-Milner
> I suspect you can use a trampoline to get around that. I am not an
> expert in such matters.
>
> Oh, and there's the experimental GHCJS, which is a mod of GHC that
> compiles to JavaScript. For realz.
that's the distributed webOS
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 17/10/2015 02:09 PM, Orchid Win7 v1 wrote:
> I've been a Haskell programmer for [at least] 10 years, and I've never
> seen *anybody* do this!
In other news:
let (,) x y = (5, 6)
This is legal. Bizarre, but true!
Suppose you have a 3-argument constructor:
data Fubar = Three Char Char Char
Now you can write something like
Three 'J' 'F' 'K'
which creates a Fubar value. But if you write just Three by itself, you
have a 3-argument function. As you'd expect.
You can create a 3-argument tuple like this:
(True, "Red", foo)
Weirdly, if you write
(,,)
this is a 3-argument function that constructs a 3-tuple. (Count the
commas carefully; notice how a *three* tuple has *two* commas in it!)
This is a fairly obscure language feature; it's mostly useful when you
want to quickly pass a tupling function as an argument to something:
zip = zipWith (,)
However, strictly speaking, that means it's legal to write
(,,) True "Red" foo
which is exactly the same as (True, "Red", foo), but with weirder syntax.
I had no idea that this is also legal *pattern* syntax! I can't imagine
why the heck you'd ever want to write it this way in a pattern. But it's
legal. So there.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 17/10/2015 02:09 PM, Orchid Win7 v1 wrote:
> I've been a Haskell programmer for [at least] 10 years, and I've never
> seen *anybody* do this!
In other news...
It turns out guards are weirder than I thought! Most humans use them
like this:
fibonacci n | n == 0 = 1
| n == 1 = 1
| otherwise = fibonacci (n-1) + fibonacci (n-2)
Or maybe
fibonacci n
| n == 0 = 1
| n == 1 = 1
| otherwise = fibonacci (n-1) + fibonacci (n-2)
But it turns out, it's 100% legal to do this:
fibonacci n | n == 0 = 1 | n == 1 = 1 | otherwise = ...
How bizarre! I had no idea you could do this... I had assumed the layout
rule applies. But, apparently, it does not. So long as all the guards
end up in the same block, it literally doesn't matter. Who knew?
(I suppose most of this basically boils down to "most people don't use
guards very much anyway"...)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 17/10/2015 01:45 PM, Orchid Win7 v1 wrote:
> I'm talking about the rule that says that 80% of people only use 20% of
> the available functionality. Or that 20% of the development effort
> implements 80% of the functionality, and the last 80% of developer time
> is required to do that last 20% of functionality.
281,309 tests
281,309 passed
0 failed
Time to initiate phase 2, I guess...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 26.10.2015 um 20:09 schrieb Orchid Win7 v1:
> 281,309 tests
> 281,309 passed
> 0 failed
Congratulations - you have successfully driven all bugs into hiding ;)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 27/10/2015 11:30 AM, clipka wrote:
> Am 26.10.2015 um 20:09 schrieb Orchid Win7 v1:
>
>> 281,309 tests
>> 281,309 passed
>> 0 failed
>
> Congratulations - you have successfully driven all bugs into hiding ;)
Congratulate me when I've written tests that actually cover everything. :-}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 27.10.2015 um 19:51 schrieb Orchid Win7 v1:
> On 27/10/2015 11:30 AM, clipka wrote:
>> Am 26.10.2015 um 20:09 schrieb Orchid Win7 v1:
>>
>>> 281,309 tests
>>> 281,309 passed
>>> 0 failed
>>
>> Congratulations - you have successfully driven all bugs into hiding ;)
>
> Congratulate me when I've written tests that actually cover everything. :-}
Just in case you didn't recognize the sarcasm: Remember that a bug in
hiding is nastier than a bug in the open :P
As for your request - sure; when hell freezes over, I'll congratulate
_everyone_ ;)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>>> Congratulations - you have successfully driven all bugs into hiding ;)
>>
>> Congratulate me when I've written tests that actually cover everything. :-}
>
> Just in case you didn't recognize the sarcasm: Remember that a bug in
> hiding is nastier than a bug in the open :P
Well, I know for a fact that there are chunks of the grammar that I
point-blank *haven't implemented yet*. Just because no tests exist for
it yet, doesn't mean it works. ;-)
> As for your request - sure; when hell freezes over, I'll congratulate
> _everyone_ ;)
Tru, dat.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 26/10/2015 07:09 PM, Orchid Win7 v1 wrote:
> 281,309 tests
> 281,309 passed
> 0 failed
>
> Time to initiate phase 2, I guess...
...or not. So far I've found at least 3 tests where the expected result
does not actually match the language specification. Yay for incorrect
test cases!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |