On Aug 23, 2009, at 15:35 , Jordan Fowler wrote:

> I sorta just threw that last bit together. Guyren, I may not be in  
> complete understanding of why you need to do this, but in my  
> opinion, it seems that you are trading well designed code for  
> convenience in a single use case. Correct me if I'm wrong.


You're wrong. :-)

I'm trying to develop a web framework that in part employs the notion  
that if all your methods accepted their arguments by name instead of  
position, then you could make *any* of them trivially available via  
HTTP (a URL is treated as a by-name function call). So I want to make  
writing by-name methods as easy as possible.

The idea is also to expose basic functional programming idioms  
automatically between such functions including via HTTP as part of the  
framework. For example, if you call one of my by-name functions and  
you don't pass it all of its required arguments, you get a curried  
function. If you do that over the web, you get back a form.

That's just part of it. There are some other ideas I'm not going to  
talk about yet.

My first test looks like this:

test_fun = fn do |f|
   f.required_args :foo, :bar
   f.optional_args :bee, :baz => 'baz'

   f.fn do
     puts "foo #{foo} bar #{bar} bee #{bee} baz #{baz}"
   end
end

test_fun[:foo => 'foo', :bar => 'bar']


Regards,

Guyren G Howe
Relevant Logic LLC

guyren-at-relevantlogic.com ~ http://relevantlogic.com ~ +1 512 784 3178

Ruby/Rails,  REALbasic, PHP programming
PostgreSQL, MySQL database design and consulting
Technical writing and training

Read my book, Real OOP with REALbasic: 
<http://relevantlogic.com/oop-book/about-the-oop-book.php 
 >


--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
sdruby@googlegroups.com
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to