[mercury-users] functions in DCGs

Dave Slutzkin dave_slutzkin at yahoo.com
Sat Jan 5 21:19:55 AEDT 2002


Hi all.

Is it impossible (or at least annoying) to use
functions in DCGs?

For example, to access the result of a function you
need to use 'L = some_function'.  But there is no such
thing as '='/4, so you need to enclose this in braces:
  { L = some_function }

But then some_function doesn't have access to the DCG
arguments it needs and so you need to state them
explicitly - destroying any DCG advantage.

The easiest solution I can think of is to write '='/4
and just copy the DCG argument.

Do DCGs and functions just not mix?

thanks,

Dave.

http://my.yahoo.com.au - My Yahoo!
- It's My Yahoo! Get your own!
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list