Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
DSL conditional syntax rules
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jason  
View profile  
 More options Oct 4, 10:34 am
From: jason <jason.franklin.sto...@gmail.com>
Date: Sun, 4 Oct 2009 07:34:16 -0700 (PDT)
Local: Sun, Oct 4 2009 10:34 am
Subject: DSL conditional syntax rules
dear groupies,

are the following DSL conditional syntax rules correct?

1. Direct comparison of m.methods not possible:

      i.e. m.foo > m.bar

      therefore this will not work.

       [ExistingAction, :action, m.aspirin_strength >
m.pain_threshold] do |v|
           puts "relief"
       end

2. Direct comparison of bindings not possible:

    i.e b(:foo) > b(:bar)

    therefore this will not work.

    [ExistingAction, :action, {m.aspirin_strength=> :a_s,
m.pain_threshold => :p_t}, b(:a_s) > b(p_t)] do |v|
       puts "relief"
   end

3. Direct comparison between m.method with Strings, Fixnum and Sym

   i.e. m.size > 20
   i.e. m.message == "hello"
   i.e. m.staus == :happy

   therefore this will work

    [ExistingAction, :action, m.aspirin_strength > 20, m.feeling ==
"awful", m.status == :unhappy] do |v|
       puts "relief"
   end

4 Indirect comparison of m.methods through binding on right hand side

   i.e. {m.foo => :foo}, m.bar == b(:foo)

   therefore this will work

    [ExistingAction, :action, {m.aspirin_strength => :a_s},
m.pain_threshold > b(:a_s)] do |v|
      puts "no relief"
    end

Is this correct - am i missing something?

thanks a million for feedback

jason.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joe Kutner  
View profile  
 More options Oct 4, 2:50 pm
From: Joe Kutner <jpkut...@gmail.com>
Date: Sun, 4 Oct 2009 13:50:05 -0500
Local: Sun, Oct 4 2009 2:50 pm
Subject: Re: [ruleby] DSL conditional syntax rules
You are correct on all four counts.

Adding the behavior you describe in #1 and #2 is certainly possible.
It would be a good starting point for someone that is interested in
contributing to the project.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jason  
View profile  
 More options Oct 4, 5:44 pm
From: jason <jason.franklin.sto...@gmail.com>
Date: Sun, 4 Oct 2009 14:44:13 -0700 (PDT)
Local: Sun, Oct 4 2009 5:44 pm
Subject: Re: DSL conditional syntax rules
Ok great to know.

I think that ruleby is totally fantastic actually (I think it actually
just saved my arse) - even if it is a pain to get into it - this is
primarily a problem with the documentation. (Ahh you are the joe on
the video http://rubyhoedown2008.confreaks.com/10-joe-kutner-ruleby-the-rule-en...
- excellent presentation by the way - you (someone) really needs to
get that on to the ruleby wiki - it really is almost a prerequisite
for understanding ruleby (much better) - regardless of CS background
or not.

I think adding the functionality described in #1 and #2 is the sugar
on top of the documentation that makes ruleby behave more like you
would expect it to - and would make the code very much more readable.

I also think that if anyone should spend time sugaring in up then to
bring it up more on the lines of Rspec, Mocha and ActiveRecord - I
think that this might open up the project to a much wider audience.

Users could then write stuff like:

  describe_rules_for "some rule book" do

     it "should do some magic stuff" do
       given a_kind_of SomeClass with(conditions => {:aaa => bbb})  do
         puts "some finky stuff"
      end
    end

  end
end

anyway i guess you get my gist.

If you need any help on the wiki doc i would be more than willing to
punch my learnings into it as a newby after one weekend. I integrated
a fully functional rule book for moving nodes around a tree - and I am
fairly happy with the code now.

I would be more than happy to help coding - just at the moment I am
very late with this project - considering that ruleby is now part of
it - this would warrent investing time in the code. (some time at the
beginning of next year I expect).

Thanks again for a great project
Jason.

On Oct 4, 8:50 pm, Joe Kutner <jpkut...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joe Kutner  
View profile  
 More options Oct 6, 12:35 pm
From: Joe Kutner <jpkut...@gmail.com>
Date: Tue, 6 Oct 2009 09:35:22 -0700 (PDT)
Local: Tues, Oct 6 2009 12:35 pm
Subject: Re: DSL conditional syntax rules
FYI I added the feature described in #1 to the trunk.  In doing so, I
decided that #2 really wasn't necessary.

On Oct 4, 4:44 pm, jason <jason.franklin.sto...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jason franklin-stokes  
View profile  
 More options Oct 6, 1:53 pm
From: jason franklin-stokes <jason.franklin.sto...@gmail.com>
Date: Tue, 6 Oct 2009 19:53:04 +0200
Local: Tues, Oct 6 2009 1:53 pm
Subject: Re: [ruleby] Re: DSL conditional syntax rules

Joe, that's excellent - I will give that a run today - this feature will
simply my code a great deal.
thanks a million.
Jason.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google