Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Lazy

Guides

  • Guide
  • MainGuide

Symbols

  • LazyDirectoryTree
  • LazyExpression
  • LazyLength
  • LazyList
  • Lazy
  • LazySplits
  • LazyTraverse
  • LazyTreeEdges
  • LazyTree
  • LazyValueArray
  • LazyValue
  • MultiwayNest
Wolfram`Lazy`
LazyExpression
​
​
LazyExpression[expr]
represents an arbitrary mutable lazy expression.
​
Details and Options

Examples  
(1)
Basic Examples  
(1)
In[1]:=
ClearLazyCache[]
Mutable reference dependency:
In[2]:=
x=
LazyExpression
[1+2]​​y=3+x​​z=4+y
Out[2]=
Out[2]=
Out[2]=
Self-reference:
In[3]:=
ones=
LazyExpression
[{1,Splice[ones]}]
Out[3]=
In[4]:=
Lazy
[Take][ones,4]
Out[4]=
Built-in methods:
In[5]:=
range=
Lazy
[Range][]
Out[5]=
In[6]:=
range
Out[6]=
In[7]:=
Lazy
[Select][2^range-1,PrimeQ]
Out[7]=
In[8]:=
Lazy
[Table][i^2,i]
Out[8]=
Contents cannot be rendered at this time; please try again later
Obligatory Fibonacci examples:
In[9]:=
fib=
LazyExpression
0,1,Splice
Lazy
[MapThread]Plus,fib,
Lazy
[Rest][fib]
Out[9]=
Contents cannot be rendered at this time; please try again later
In[10]:=
next[{1,2}]
Out[10]=
In[11]:=
fib=
LazyExpression
@
Lazy
[FoldList][Plus,0,{1,Splice[fib]}]
Out[11]=
In[12]:=
LazyExpression
First/@
Lazy
[NestList][Replace[{a_,b_}{b,a+b}],{0,1}]
Out[12]=
In[13]:=
fib=
LazyExpression
0,1,Splice@
Lazy
[Table,fib〚n-2〛+fib〚n-1〛,{n,3,Infinity}]
Out[13]=
Contents cannot be rendered at this time; please try again later
In[14]:=
ClearAll[fib]​​fib[1]=1;​​fib[2]=1;​​fib[n_Integer]:=fib[n]=
LazyExpression
[fib[n-2]+fib[n-1]]
In[15]:=
fibs=Table[fib[n],{n,10}]
Out[15]=
Contents cannot be rendered at this time; please try again later
In[16]:=
Scan[Print[HoldForm[Evaluate[fib[#]]]]&,Range[10]]
In[17]:=
f[x_?NumericQ]:=
1
Floor[x]+1-FractionalPart[x]
​​positiveRationals=
Lazy
[NestList][f,0]​​rationals=
LazyExpression
@
Lazy
[MapThread]Splice@*List,positiveRationals,
Lazy
[Map][Minus]@
Lazy
[Rest]@positiveRationals
Out[17]=
Out[17]=
Contents cannot be rendered at this time; please try again later

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com