Comments (2)
You're probably right. Even I actually ended up not using destructuring at all in the place I originally wanted to use this :)
Appreciate the example though. Thanks!
from rutils.
Yes, that is correct. I have almost never seen array destructuring in practical use.
However, it can be implemented by the user. For example, like this:
RTL-USER> (defmethod bind-dispatch ((arg1 array) arg2 &rest args)
(declare (ignore args))
(let ((garg2 (gensym)))
`(let* ((,garg2 ,arg2)
,@(mapindex (lambda (i arg) `(,arg (aref ,garg2 ,i)))
(coerce arg1 'list))))))
WARNING:
redefining BIND-DISPATCH (#<BUILT-IN-CLASS COMMON-LISP:ARRAY>
#<SB-PCL:SYSTEM-CLASS COMMON-LISP:T>) in DEFMETHOD
#<STANDARD-METHOD RUTILS.BIND:BIND-DISPATCH (ARRAY T) {10178E61A3}>
RTL-USER> (m1 '(with ((#(a b) #(1 2 3)))
b))
(LET* ((#:G716 #(1 2 3)) (A (AREF #:G716 0)) (B (AREF #:G716 1)))
B)
T
RTL-USER> (with ((#(a b) #(1 2 3)))
b)
; in: WITH ((#(A B) #(1 2 3)))
; (LET* ((#:G717 #(1 2 3))
; (RTL-USER::A (AREF #:G717 0))
; (RTL-USER::B (AREF #:G717 1)))
; RTL-USER::B)
;
; caught STYLE-WARNING:
; The variable A is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
2
from rutils.
Related Issues (20)
- generic-elt with negative keys (list/vector)
- Iterate's example of "in" does not work with rutils HOT 3
- Help: := is a macro, not a function. [Condition of type UNDEFINED-FUNCTION] HOT 3
- Broken today - "The variable BY occurs more than once in the lambda list." HOT 1
- setf macro issue HOT 2
- with/bind ignorable variable `_' generates "unused lexical variable" compiler warning HOT 1
- dotable compilation breaks if body contains (declare (ignore ...)) HOT 1
- VOID macro declaimed as inline HOT 1
- dotable _ weirdness HOT 3
- RUTILS.ITER:ITER, :in-vector or :in-sequence "The value NIL is not of type NUMBER"
- Feature request: (setf (rutil.lt X) Y) and similar for rutil.rt HOT 1
- Broken docs on quickdocs
- Style warning in SBCL (unused variable) using DOPLIST HOT 2
- Fails to loop `:in-vector` HOT 1
- Tests fails on ABCL 1.9.2
- 5 tests currently failed in the latest commit `79cb029` HOT 1
- Potential bugs for `RUTILS:ITER`
- `smart-slot-value` fails
- `bind` fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rutils.