Actually Compat doesn't rewrite the code to call 'names' but just defines 'fieldnames' directly. So either
import Compat Compat.fieldnames(x) or using Compat fieldnames(x) is sufficient. On Wednesday, October 14, 2015 at 4:47:36 PM UTC-4, Milan Bouchet-Valat wrote: > > Le mercredi 14 octobre 2015 à 11:44 -0700, Martin Maechler a écrit : > > > > > > Am Montag, 13. April 2015 17:43:54 UTC+2 schrieb Stefan Karpinski: > > > You are probably on Julia 0.3.x in which this function was called > > > `names`. You can either use `names` or use the Compat package which > > > lets you use names from the future. > > > > > So, if we have code (in ESS https://github.com/emacs/ESS/ ) which > > needs to work with both julia 0.3 and 0.4 we should use names() and > > the 'Compat' package. > > @Stefan Karpinski : Can you paste julia code for using 'Compat' > > such that it also works in 0.3 ? > You simply need to do: > @Compat.compat fieldnames(x) > > or > > using Compat > @compat fieldnames(x) > > > Don't forget to add Compat to the REQUIRES file of your package. > > Regards > > > > > > > On Mon, Apr 13, 2015 at 11:37 AM, 'Antoine Messager' via julia > > > -users <[email protected]> wrote: > > > > Hi, > > > > > > > > I would like to find the field of SolverResults{Float64}. So > > > > according to the manual, I just need to use the method fieldnames > > > > but unfortunately it is not defined. > > > > What can I do? > > > > > > > > Thank you, > > > > Antoine > > > > > > > >
