splitting up a literal

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

splitting up a literal

Marcel Spitzer
Hello,

is it possible to split up a literal into multiple sub-literals? Or to
get a new literal by subsetting an existing literal? For example, if we
have the literal "str1(str2)", I would like to get "str1" as a new literal.

Cheers,
Marcel

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: splitting up a literal

Jomi Hubner
Hi Marcel,

you can use the =.. operator, e.g.

        b(1,a) =.. X

will unify X with

        [b,[1,a],[]]

i.e., a list with 3 elements: the functor, the terms, and the annotations.

if you want just the functor:

        b(1,a) =.. [F|_]

F will unify with b. Then you can build new literals:

        NewLiteral =.. [F,[2,x],[an1,an2]]

NewLiteral will be: b(2,x)[an1,an2]

HTH,

Jomi





> On 21/05/2015, at 07:44, Marcel Spitzer <[hidden email]> wrote:
>
> Hello,
>
> is it possible to split up a literal into multiple sub-literals? Or to
> get a new literal by subsetting an existing literal? For example, if we
> have the literal "str1(str2)", I would like to get "str1" as a new literal.
>
> Cheers,
> Marcel
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Jason-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jason-users

--
Jomi Fred Hubner
Federal University of Santa Catarina
Department of Automation and Systems Engineering
PO Box 476, Florianópolis, SC
88040-900 Brazil
http://www.das.ufsc.br/~jomi


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Loading...