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


Groups > comp.lang.forth > #55688

Re: Collections processing in Oforth

From Ron Aaron <rambamist@gmail.com>
Newsgroups comp.lang.forth
Subject Re: Collections processing in Oforth
Date 2017-03-12 13:02 +0200
Organization A noiseless patient Spider
Message-ID <oa39n8$qu3$1@dont-email.me> (permalink)
References <47e67d0c-b5b7-4c2a-8fce-551956ad05d6@googlegroups.com> <b73e6ddf-d687-4789-8d8a-8bd252de9bee@googlegroups.com> <e47e588d-cb2d-481e-a42f-a1d2c6de4f70@googlegroups.com>

Show all headers | View raw



On 12/03/2017 12:49, franck.bensusan@gmail.com wrote:

> Polymorphism is used a lot because linked lists are not the only
> kind of collection in the world.
> 
> If I understand well, you have, for linked lists : 
> 1) EACH[ and ]EACH (forEach: [ ] in Oforth).
> 2) EACH to apply a "toucher" on each node (apply word in Oforth).
> 
> But what about arrays, strings, matrix, stacks, sets, hash, MemBuffer, ...
> I imagine the linked list is not the only kind of collection you 
> provide, no ?
> 
> For instance, what are the words you use to process arrays ? 
> Can you use EACH[ ]EACH and EACH with them ?
> (and, if not, did you use the "cut and paste" technic to create them ?)
> 
> In Oforth, "forEach:" and "apply" work with all kind of collections,
> not only linked lists, because they use a polymorphic method : forEachNext

This is one difference between Oforth and 8th.  Both have various
containers, and both allow iteration and various operations on them.

But Oforth is OOP-oriented, hence the polymorphism, while 8th is
explicitly non-OOP.  Despite that, one may get confused and think 8th is
OOP since there is an "each" word for arrays, maps, etc. (and many other
similar things).  It has a veneer of OOP-ishness.

Do you implement your OOP using some sort of 'vtable' dispatch mechanism?

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Collections processing in Oforth franck.bensusan@gmail.com - 2017-03-11 04:56 -0800
  Re: Collections processing in Oforth minforth@arcor.de - 2017-03-11 05:27 -0800
    Re: Collections processing in Oforth franck.bensusan@gmail.com - 2017-03-12 01:41 -0800
      Re: Collections processing in Oforth hughaguilar96@gmail.com - 2017-03-12 20:03 -0700
  Re: Collections processing in Oforth hughaguilar96@gmail.com - 2017-03-11 15:36 -0800
    Re: Collections processing in Oforth franck.bensusan@gmail.com - 2017-03-12 03:49 -0700
      Re: Collections processing in Oforth Ron Aaron <rambamist@gmail.com> - 2017-03-12 13:02 +0200
        Re: Collections processing in Oforth franck.bensusan@gmail.com - 2017-03-12 05:06 -0700
          Re: Collections processing in Oforth Ron Aaron <rambamist@gmail.com> - 2017-03-13 08:05 +0200
            Re: Collections processing in Oforth franck.bensusan@gmail.com - 2017-03-13 05:25 -0700
              Re: Collections processing in Oforth Ron Aaron <rambamist@gmail.com> - 2017-03-13 15:29 +0200
      Re: Collections processing in Oforth hughaguilar96@gmail.com - 2017-03-12 20:01 -0700
  Re: Collections processing "Robert L." <No_spamming@noWhere_7073.org> - 2017-03-29 11:51 +0000

csiph-web