We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
length
BasicSymbolic
1 parent 8870978 commit 8d18d9dCopy full SHA for 8d18d9d
src/utils.jl
@@ -183,7 +183,12 @@ Base.length(l::LL) = length(l.v)-l.i+1
183
@inline car(l::LL) = l.v[l.i]
184
@inline cdr(l::LL) = isempty(l) ? empty(l) : LL(l.v, l.i+1)
185
186
-Base.length(t::BasicSymbolic) = length(arguments(t)) + 1 # PIRACY
+function Base.length(t::BasicSymbolic)
187
+ @match t.impl begin
188
+ Term(_...) => length(arguments(t)) + 1 # PIRACY
189
+ _ => 1
190
+ end
191
+end
192
Base.isempty(t::BasicSymbolic) = false
193
@inline car(t::BasicSymbolic) = operation(t)
194
@inline cdr(t::BasicSymbolic) = arguments(t)
0 commit comments