Full output in function definition

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 558
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Full output in function definition

Message par compsystems » dim. nov. 11, 2018 2:16 pm

Hello, BP.

Idea: When defining a function, return the complete definition expression, with the purpose of recovering it in a subsequent operation.

f1(x) := 2*x -3; [enter] returns currently (x) -> 2*x-3
=> f1 := x -> 2*x-3

f2(x) := x² + 1; [enter] f2 := x -> x² + 1

autosimplify(0):; f3(x):=f1(f2(x)) [enter] f3 := x->f1( f2(x) )

[edit Ans(-1)]
f3 := x->f2( f1(x) )

f4 := unapply(f1(f2(x)),x) [enter] f4 := x->2*(x^2+1)-3

unapply(2*x^2,x) [enter] x->2*x^2

Thank you

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Full output in function definition

Message par parisse » dim. nov. 11, 2018 6:34 pm

This is not possible because a:=b returns the value of b.

Répondre