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


Groups > comp.lang.python > #81275

Re: Infinitely nested containers

Newsgroups comp.lang.python
Date 2014-11-21 22:03 -0800
References (2 earlier) <mailman.16114.1416591558.18130.python-list@python.org> <54701468$0$12986$c3e8da3$5496439d@news.astraweb.com> <mailman.16134.1416631815.18130.python-list@python.org> <4cecd824-19c6-4be3-b91b-06602313d0ae@googlegroups.com> <mailman.16135.1416633006.18130.python-list@python.org>
Message-ID <3b7cae0e-8e3e-43a5-a5ee-767a3df867c8@googlegroups.com> (permalink)
Subject Re: Infinitely nested containers
From Rustom Mody <rustompmody@gmail.com>

Show all headers | View raw


On Saturday, November 22, 2014 10:40:23 AM UTC+5:30, Chris Angelico wrote:
> On Sat, Nov 22, 2014 at 4:02 PM, Rustom Mody  wrote:
> > Thats not a single expression; which is possible with a lazy
> > evaluation language like Haskell.
> > Prelude> let ones = 1 : ones
> 
> I'm not sure "lazy evaluation" is the key here, unless it also does
> name lookups lazily. What happens if you do this:
> 
> let foo = 1 : bar
> let bar = 2 : 3
> foo
> 
> Will that show 1, 2, 3? If so, then sure, lazy eval is what achieved
> that - but it's also going to make it hard to track down name errors.

Prelude> let foo = 1 : bar; bar = 2 : [3]
Prelude> foo
[1,2,3]


Prelude> let foo = 1 : bar; bar = 2 : foo
Prelude> foo
[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1 <Control-C>

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


Thread

Infinitely nested containers Gill Shen <gillarete@gmail.com> - 2014-11-20 21:54 -0800
  Re: Infinitely nested containers Marko Rauhamaa <marko@pacujo.net> - 2014-11-21 09:00 +0200
    Re: Infinitely nested containers random832@fastmail.us - 2014-11-21 12:39 -0500
      Re: Infinitely nested containers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-22 15:43 +1100
        Re: Infinitely nested containers Chris Angelico <rosuav@gmail.com> - 2014-11-22 15:50 +1100
          Re: Infinitely nested containers Rustom Mody <rustompmody@gmail.com> - 2014-11-21 21:02 -0800
            Re: Infinitely nested containers Chris Angelico <rosuav@gmail.com> - 2014-11-22 16:09 +1100
              Re: Infinitely nested containers Rustom Mody <rustompmody@gmail.com> - 2014-11-21 22:03 -0800
        Re: Infinitely nested containers Ethan Furman <ethan@stoneleaf.us> - 2014-11-22 11:50 -0800
          Re: Infinitely nested containers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-23 16:59 +1100
            Re: Infinitely nested containers random832@fastmail.us - 2014-11-23 01:39 -0500
    Re: Infinitely nested containers Chris Angelico <rosuav@gmail.com> - 2014-11-22 04:47 +1100
    Re: Infinitely nested containers random832@fastmail.us - 2014-11-21 12:50 -0500
    Re: Infinitely nested containers Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-21 11:37 -0700
    Re: Infinitely nested containers Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-11-21 13:30 -0600
    Re: Infinitely nested containers Terry Reedy <tjreedy@udel.edu> - 2014-11-22 16:57 -0500
  Re: Infinitely nested containers Chris Angelico <rosuav@gmail.com> - 2014-11-21 18:03 +1100
  Re: Infinitely nested containers Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-21 10:13 -0700

csiph-web