Prev: graph breadth first search
Next: insurance,car insurance,auto insurance company,car insurance rate,cheap car insurance
From: Krzysztof Drewniak on 25 Jun 2010 10:18 I am trying to develop a roguelike game in lisp. This game has a platform+implementation bit to select the name of the player. On *nix, it just rips your login id. On clisp, there is a small problem. Somewhere between 2.44 and 2.48 the function (posix:getuid) was renames to (posix:uid) . The application will be fired up with both old and new versions of clisp and I need a workaround to work with both and not trigger the "Package POSIX has no external symbol GETUID/UID" which is what happens if I try (if (bpoudp '...) ... other...) Thank you, Krzysztof P.S. The code in question can be seen at http://motm.svn.sourceforge.net/viewvc/motm/trunk/src/input.lisp?revision=131&view=markup (line 67) -- X-Real-Email-With-Antispam: krzysdrewniak at gmail dot com pgp key on keyserver.ubuntu.com and maybe some other place too
From: Zach Beane on 25 Jun 2010 10:26 Krzysztof Drewniak <krzysdrewniakNOSPAM(a)gmai.com> writes: > I am trying to develop a roguelike game in lisp. This game has a > platform+implementation bit to select the name of the player. On *nix, > it just rips your login id. On clisp, there is a small > problem. Somewhere between 2.44 and 2.48 the function (posix:getuid) was > renames to (posix:uid) . The application will be fired up with both old > and new versions of clisp and I need a workaround to work with both and > not trigger the "Package POSIX has no external symbol GETUID/UID" which > is what happens if I try (if (bpoudp '...) ... other...) One possibility: (funcall (or (find-symbol "UID" "POSIX") (find-symbol "GETUID" "POSIX") (error "Couldn't find POSIX:UID or POSIX:GETUID"))) Zach
From: Pascal J. Bourguignon on 25 Jun 2010 14:47 Zach Beane <xach(a)xach.com> writes: > Krzysztof Drewniak <krzysdrewniakNOSPAM(a)gmai.com> writes: > >> I am trying to develop a roguelike game in lisp. This game has a >> platform+implementation bit to select the name of the player. On *nix, >> it just rips your login id. On clisp, there is a small >> problem. Somewhere between 2.44 and 2.48 the function (posix:getuid) was >> renames to (posix:uid) . The application will be fired up with both old >> and new versions of clisp and I need a workaround to work with both and >> not trigger the "Package POSIX has no external symbol GETUID/UID" which >> is what happens if I try (if (bpoudp '...) ... other...) > > One possibility: > > (funcall (or (find-symbol "UID" "POSIX") > (find-symbol "GETUID" "POSIX") > (error "Couldn't find POSIX:UID or POSIX:GETUID"))) > > Zach (funcall (or (ignore-errors (find-symbol "UID" "POSIX")) (ignore-errors (find-symbol "GETUID" "POSIX")) (error "Couldn't find POSIX:UID or POSIX:GETUID"))) or: (funcall (if (find-package "POSIX") (or (find-symbol "UID" "POSIX") (find-symbol "GETUID" "POSIX") (error "Couldn't find POSIX:UID or POSIX:GETUID")) (error "Couldn't even find the POSIX package"))) -- __Pascal Bourguignon__ http://www.informatimago.com/
From: Krzysztof Drewniak on 25 Jun 2010 15:52 pjb(a)informatimago.com (Pascal J. Bourguignon) writes: > Zach Beane <xach(a)xach.com> writes: > >> Krzysztof Drewniak <krzysdrewniakNOSPAM(a)gmai.com> writes: >> >>> I am trying to develop a roguelike game in lisp. This game has a >>> platform+implementation bit to select the name of the player. On *nix, >>> it just rips your login id. On clisp, there is a small >>> problem. Somewhere between 2.44 and 2.48 the function (posix:getuid) was >>> renames to (posix:uid) . The application will be fired up with both old >>> and new versions of clisp and I need a workaround to work with both and >>> not trigger the "Package POSIX has no external symbol GETUID/UID" which >>> is what happens if I try (if (bpoudp '...) ... other...) >> >> One possibility: >> >> (funcall (or (find-symbol "UID" "POSIX") >> (find-symbol "GETUID" "POSIX") >> (error "Couldn't find POSIX:UID or POSIX:GETUID"))) >> >> Zach > > (funcall (or (ignore-errors (find-symbol "UID" "POSIX")) > (ignore-errors (find-symbol "GETUID" "POSIX")) > (error "Couldn't find POSIX:UID or POSIX:GETUID"))) > > or: > > (funcall (if (find-package "POSIX") > (or (find-symbol "UID" "POSIX") > (find-symbol "GETUID" "POSIX") > (error "Couldn't find POSIX:UID or POSIX:GETUID")) > (error "Couldn't even find the POSIX package"))) Zach's solution worked. This is also one of the more helpful groups on USENET. Krzysztof Drewniak. -- X-Real-Email-With-Antispam: krzysdrewniak at gmail dot com pgp key on keyserver.ubuntu.com and maybe some other place too
From: Pascal J. Bourguignon on 25 Jun 2010 16:11
Krzysztof Drewniak <krzysdrewniakNOSPAM(a)gmai.com> writes: > pjb(a)informatimago.com (Pascal J. Bourguignon) writes: > >> Zach Beane <xach(a)xach.com> writes: >> >>> Krzysztof Drewniak <krzysdrewniakNOSPAM(a)gmai.com> writes: >>> >>>> I am trying to develop a roguelike game in lisp. This game has a >>>> platform+implementation bit to select the name of the player. On *nix, >>>> it just rips your login id. On clisp, there is a small >>>> problem. Somewhere between 2.44 and 2.48 the function (posix:getuid) was >>>> renames to (posix:uid) . The application will be fired up with both old >>>> and new versions of clisp and I need a workaround to work with both and >>>> not trigger the "Package POSIX has no external symbol GETUID/UID" which >>>> is what happens if I try (if (bpoudp '...) ... other...) >>> >>> One possibility: >>> >>> (funcall (or (find-symbol "UID" "POSIX") >>> (find-symbol "GETUID" "POSIX") >>> (error "Couldn't find POSIX:UID or POSIX:GETUID"))) >>> >>> Zach >> >> (funcall (or (ignore-errors (find-symbol "UID" "POSIX")) >> (ignore-errors (find-symbol "GETUID" "POSIX")) >> (error "Couldn't find POSIX:UID or POSIX:GETUID"))) >> >> or: >> >> (funcall (if (find-package "POSIX") >> (or (find-symbol "UID" "POSIX") >> (find-symbol "GETUID" "POSIX") >> (error "Couldn't find POSIX:UID or POSIX:GETUID")) >> (error "Couldn't even find the POSIX package"))) > Zach's solution worked. Yes. Until you find a clisp without a POSIX package, and you come back here asking how to deal with versions of clisp without a POSIX package... Notice also that FFI and LINUX are not always present. > This is also one of the more helpful groups on USENET. -- __Pascal Bourguignon__ http://www.informatimago.com/ |