[plt-scheme] Re: (newbie question) About Loop
Thanks a lot :)
Won't it be inefficient building list for large values (say thousands
instead of 10)? Isn't there any direct loop syntax in Scheme?
On Jun 12, 12:00 pm, Jon Rafkind <rafk... at cs.utah.edu> wrote:
> MD.MAHBUBUR RASHEED wrote:
> > Hi,
> > How can I implement loop in plt-scheme like in java-
>
> > for(int i=0;i<10;){
> > for(int j=0;j<3;){
> > System.out.println(""+j);
> > j++;
> > }
> > System.out.println(""+i);
> > i++;
> > }
>
> (for-each (lambda (i)
> (for-each (lambda (j) (printf "~a\n" j)) (build-list 3
> (lambda (x) x)))
> (printf "~a\n" i))
> (build-list 10 (lambda (x) x)))
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme