[Prototype-core] Re: Function.EMPTY and Function.K

2009-09-29 Thread Richard Quadling

2009/9/29 Joran Greef jorangr...@gmail.com:

 Prototype's existing String.empty and Array.empty interfaces would
 imply that Function.empty return a boolean indicating perhaps that the
 function is empty.
 


Numpty brain this morning, but ...

As I understand things, K(x) = x, not K(x) = (fn() = x)



-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Function.EMPTY and Function.K

2009-09-29 Thread Jim Higson

On Tuesday 29 September 2009 06:49:15 Joran Greef wrote:
 Prototype's existing String.empty and Array.empty interfaces would
 imply that Function.empty return a boolean indicating perhaps that the
 function is empty.

Well, it *could* do:

Function.empty = function(){};
Function.empty.empty = function(){return true};

Of course this doesn't cover other empty functions and I may be not entirely 
serious ;-)

Jim

-- 
Jim
my wiki ajaxification thing: http://wikizzle.org
my blog: http://jimhigson.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Ajax.Responders.register for onFailure event

2009-09-29 Thread Richard Quadling

2009/9/28 Mona Remlawi mona.reml...@gmail.com:

 i knew it, i had asked the same question before [10/29/08]
 so i'll stick to the same recommended patch at
 [http://prototype.lighthouseapp.com/projects/8886/tickets/334-onsuccessfailure-not-dispatched-to-ajaxresponders]
 while waiting for the anax revamp in v2

 thanks and sorry for the double post.

 cheers

 --
 mona

 On Mon, Sep 28, 2009 at 11:35 AM, Mona Remlawi mona.reml...@gmail.com wrote:
 Hello Prototypers,

 Any reason why the Ajax.Responders does not support the registration
 of handlers for onFailure event?

 cheers

 --
 mona


 


Also http://dev.rubyonrails.org/ticket/9690

-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Function.EMPTY and Function.K

2009-09-29 Thread T.J. Crowder

Being serious for a moment, it sounds like we're all happy (enough)
with Function.empty.

Can't say I *like* Function.identity (I'd prefer Function.passBack)
but it at least is readily defensible as being derived from
mathematics (like curry) and there are several yea vote for it in
this thread.

-- T.J. :-)

On Sep 29, 8:58 am, Jim Higson j...@wikizzle.org wrote:
 On Tuesday 29 September 2009 06:49:15 Joran Greef wrote:

  Prototype's existing String.empty and Array.empty interfaces would
  imply that Function.empty return a boolean indicating perhaps that the
  function is empty.

 Well, it *could* do:

 Function.empty = function(){};
 Function.empty.empty = function(){return true};

 Of course this doesn't cover other empty functions and I may be not entirely
 serious ;-)

 Jim

 --
 Jim
 my wiki ajaxification thing:http://wikizzle.org
 my blog:http://jimhigson.blogspot.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Function.EMPTY and Function.K

2009-09-29 Thread Joran Greef

Agreed. I like Function.identity as well for the same reason in that
there is in fact a reason. I don't think Function.empty has the same
going for it, apart from it being the legacy terminology. We could do
better.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Suggestion: DOM storage methods to Prototype

2009-09-29 Thread andris

Hi,

I've implemented a simple library on the top of DOM storage and IE
userData to act as a browser side caching solution called DOMCached
(www.domcached.com). The library acts like a kind of javascript
memcached caching solution - a script can store objects to the cache
and retrieve it later on another pageview.

For example if the user is already made an Ajax request and the data
is stored to the DOMCache then there is no need to do this request to
the server again. Or if you try to fill out a form and your browser
crashes - if the data was stored to the cache by the script then
nothing is lost when you re-open the form. And so on, the
possibilities are endless.

Anyhow - I was wondering if similar functionality (or DOMCached
itself) could be added to the Prototype library?


Best regards,
Andris Reinman

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Suggestion: DOM storage methods to Prototype

2009-09-29 Thread Mark Holton
On Tue, Sep 29, 2009 at 7:12 AM, andris andris.rein...@gmail.com wrote:


 Hi,

 I've implemented a simple library on the top of DOM storage and IE
 userData to act as a browser side caching solution called DOMCached
 (www.domcached.com). The library acts like a kind of javascript
 memcached caching solution - a script can store objects to the cache
 and retrieve it later on another pageview.

 For example if the user is already made an Ajax request and the data
 is stored to the DOMCache then there is no need to do this request to
 the server again. Or if you try to fill out a form and your browser
 crashes - if the data was stored to the cache by the script then
 nothing is lost when you re-open the form. And so on, the
 possibilities are endless.

 Anyhow - I was wondering if similar functionality (or DOMCached
 itself) could be added to the Prototype library?


 Best regards,
 Andris Reinman


+1
As a user of Prototype, I'd like to see something like this added.  Clean,
simple and useful.
Mark

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Suggestion: DOM storage methods to Prototype

2009-09-29 Thread kangax

On Sep 29, 10:12 am, andris andris.rein...@gmail.com wrote:
 Hi,

 I've implemented a simple library on the top of DOM storage and IE
 userData to act as a browser side caching solution called DOMCached
 (www.domcached.com). The library acts like a kind of javascript
 memcached caching solution - a script can store objects to the cache
 and retrieve it later on another pageview.

 For example if the user is already made an Ajax request and the data
 is stored to the DOMCache then there is no need to do this request to
 the server again. Or if you try to fill out a form and your browser
 crashes - if the data was stored to the cache by the script then
 nothing is lost when you re-open the form. And so on, the
 possibilities are endless.

I've done something similar (although not publicly available yet) :)

Why don't you use database abstraction when available? It would fill
in those Safari 3 and Chrome gaps.


 Anyhow - I was wondering if similar functionality (or DOMCached
 itself) could be added to the Prototype library?

I can't speak for everyone in the core, but most definitely not. This
is clearly more suited for a standalone module.

On a side note, I haven't noticed any unit tests; only functional ones
on the front page.

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Suggestion: DOM storage methods to Prototype

2009-09-29 Thread andris

Thank you for the replies!

 Why don't you use database abstraction when available? It would fill
 in those Safari 3 and Chrome gaps.

Do you mean database abstraction as a server side database? My point
was only to use browser-side for the caching.

 On a side note, I haven't noticed any unit tests; only functional ones
 on the front page.

Sorry for that, the idea struck me yesterday and I immediately tried
to implement it (along with the domain registration and so on:) ), so
there hasn't been much time to come up with the correct tests.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Suggestion: DOM storage methods to Prototype

2009-09-29 Thread Mark Holton
On Tue, Sep 29, 2009 at 1:37 PM, kangax kan...@gmail.com wrote:



 I can't speak for everyone in the core, but most definitely not. This
 is clearly more suited for a standalone module.


Actually, you changed my [user] mind.  Module makes more sense.  Core libs
shouldn't get bloated.

(but this is good to know about, thanks!)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Suggestion: DOM storage methods to Prototype

2009-09-29 Thread kangax

On Sep 29, 5:48 pm, andris andris.rein...@gmail.com wrote:
 Thank you for the replies!

  Why don't you use database abstraction when available? It would fill
  in those Safari 3 and Chrome gaps.

 Do you mean database abstraction as a server side database? My point
 was only to use browser-side for the caching.

Nope. I mean clean-side database storage - http://webkit.org/blog/126/
webkit-does-html5-client-side-database-storage/

[...]

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Suggestion: DOM storage methods to Prototype

2009-09-29 Thread Yaffle

I use small (40 lines of code) storage class, that uses cookies or
localStorage.

IMHO, userData and databases not so usefull:
IE userData behavior relies on DOM.
database works in webkit, which supports localStorage.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Suggestion: DOM storage methods to Prototype

2009-09-29 Thread kangax



On Sep 30, 12:01 am, Yaffle vic99...@yandex.ru wrote:
[...]
 database works in webkit, which supports localStorage.

Not in Safari 3 and not in any version of Chrome as of now (although,
Chrome is working on `localStorage` at the moment -
http://code.google.com/p/chromium/issues/detail?id=4360).

Both - Safari 3 and Chrome - have database storage, though.

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Suggestion: DOM storage methods to Prototype

2009-09-29 Thread Yaffle

Yes that's is, but Safari and Chrome isn't popular browsers.(depends
on site audience)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---