Re: Functional syntax

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 12/04/2013 01:10 PM, Kilian Evang wrote:
> Now that Jan has made it clear that the new features are not going to go
> away, I'd like to bump my proposal to take functional syntax one step
> further:
>
> On 28-11-13 13:44, Kilian Evang wrote:
>> But why stop at dicts? Can we also get a ./1
>> which also "evaluates expressions in place" without a dict to call it
>> "on"? The functional syntax so far provides "method calls", why not also
>> "function calls"? For example:
>>
>> calc(Expr) := Result :-
>>    Result is Expr.
>>
>> ?- length(List, .calc(1 + 1)).
>> List = [_G1821, _G1824].
>
> Any opinions on this?

I provisionally like this.  As there are several issues to be
resolved wrt. function expansion in the first place, I'm not
in a hurry though.  Note that right now, you can get this to
work as expected (using is/calc/eval/...):

	length(List, math{}.is(1+1)).

My first goal is to get V7 stable wrt. the new features and
exploit these features in the libraries.  This includes finding
solutions for people getting into trouble with some of the
new features.

	Cheers --- Jan

P.s.	Functional expansion is not a trivial exercise.  It is
	quite likely that I will allow specifying that other
	terms can be expanded as well.  Also, no hurry here.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.