Menu

#685 (machine-instance) is caching its result

open
None
1
2017-02-27
2016-06-21
Daniel Jour
No

Calling (machine-instance) returns the result of the first call to that function on subsequent calls. Given that it returns data that could change this seems wrong to me. Also the HyperSpec does not mention any "side effects" (caching is a side effect?).

I'm filing this bug so that this can be checked / discussed.

Discussion

  • Sam Steingold

    Sam Steingold - 2016-08-26

    indeed, the ip address can change (and the name might too).
    we could change it, I guess...

     
  • Sam Steingold

    Sam Steingold - 2017-02-27
    • assigned_to: Bruno Haible
     
  • Sam Steingold

    Sam Steingold - 2017-02-27

    We could add a function (machine-id &optional what)
    which would do
    if what is nil, return the cache
    if what is t, the cache is recomputed
    if what is a string, the cache is set to that string.
    (maching-instance) is the same as (machine-id).

    Bruno, what do you think we should do?

     
  • Sam Steingold

    Sam Steingold - 2017-02-27

    BTW, it is not obvious that IP address is TRT.
    http://clhs.lisp.se/Body/f_mach_i.htm:

    Returns a string that identifies the particular instance of the computer hardware

    IOW, hardware MAC address seems like a better candidate.
    It is much less useful, obviously.

     

Log in to post a comment.