Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7175

Re: getting in between results of chunks of ruby code, by how???

From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.ruby
Subject Re: getting in between results of chunks of ruby code, by how???
Date 2015-12-23 11:14 +0100
Message-ID <ddvag6Fug3jU1@mid.individual.net> (permalink)
References <5fc33a05-0c6f-4082-a815-3dc044b13cff@googlegroups.com> <ddu37fFlkt1U1@mid.individual.net> <b368625d-aa48-44e2-a0bf-642e0975223f@googlegroups.com>

Show all headers | View raw


On 23.12.2015 10:37, artbot wrote:

> it's going to be part of my (very specialized) template engine.

And what makes it special?  What are your requirements etc.?

> it should be as code/ruby agnostic as possible. evaluating each block
> should just recognize if it produces a result or not. also repetitions
> should get recognized (as above)

You cannot recognize that and be Ruby agnostic at the same time.  Just 
look at your example: you have a block there as second array element 
which is invoked an unknown number of times by the first chunk.  So you 
would somehow have to tap into the callback from #times and store all 
evaluation results of the block's body etc.  No way this flies by only 
being mildly Ruby agnostic.

> any more ideas?

You provide the requirements, others can come up with ideas.

Regards

	robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

getting in between results of chunks of ruby code, by how??? artbot <am@artbot.de> - 2015-12-22 12:13 -0800
  Re: getting in between results of chunks of ruby code, by how??? Robert Klemme <shortcutter@googlemail.com> - 2015-12-23 00:04 +0100
    Re: getting in between results of chunks of ruby code, by how??? artbot <am@artbot.de> - 2015-12-23 01:37 -0800
      Re: getting in between results of chunks of ruby code, by how??? Robert Klemme <shortcutter@googlemail.com> - 2015-12-23 11:14 +0100
        Re: getting in between results of chunks of ruby code, by how??? artbot <am@artbot.de> - 2015-12-23 05:49 -0800
          Re: getting in between results of chunks of ruby code, by how??? artbot <am@artbot.de> - 2015-12-23 11:02 -0800

csiph-web