# Match on structure, bind whole value

**URL:** <https://swi-prolog.discourse.group/t/match-on-structure-bind-whole-value/1678>\
**Category:** Help!\
**Tags:** logtalk\
**Created:** [December 31, 2019, 11:51am UTC](https://swi-prolog.discourse.group/t/match-on-structure-bind-whole-value/1678 "2019-12-31T11:51:49Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [January 2, 2020, 5:15pm UTC](https://swi-prolog.discourse.group/t/match-on-structure-bind-whole-value/1678/28 "2020-01-02T17:15:59Z")

</div>

> [@abramobagnara](#):
>
> I assume you are considering that a similar effect can be accomplished using:
> 
> ```prolog
> p(L) :- L = [H|T], ..., q(L).
> 
> ```

Surely you can achieve that after source transformation. A brief investigation shows that indexing the above for the default first argument indexing which is used for predicates with not many clauses and called with an instantiated first argument is probably not too hard.

[Previous page](https://swi-prolog.discourse.group/t/match-on-structure-bind-whole-value/1678.md?page=1)
