gap-packages / JupyterKernel

Native Jupyter kernel for GAP
https://gap-packages.github.io/JupyterKernel/
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

NamesUserGVars(); #17

Open pedritomelenas opened 7 years ago

pedritomelenas commented 7 years ago

NamesUserGVars(); outputs many variables that where not "defined" by the user in the prompt. In fact the user unintentially defines them when launching the kernel.

[ "CRYPTING_HexStringIntPad", "CRYPTING_HexStringIntPad8", "CRYPTING_SHA256_FINAL", 
"CRYPTING_SHA256_HMAC", "CRYPTING_SHA256_INIT", "CRYPTING_SHA256_State_Family", 
"CRYPTING_SHA256_State_Type", "CRYPTING_SHA256_UPDATE", "GAPJupyterKernelType", 
"GET_HELP_URL", "GapToJsonStream", "GapToJsonString", "HMACSHA256", 
"HPCGAPJupyterKernelType", "HexStringUUID", "ISO8601Stamp", "IsGAPJupyterKernel", 
"IsHPCGAPJupyterKernel", "IsJupyterKernel", "IsSHA256State", "IsUUID", "IsUUIDBlistRep", 
"IsZmqSocket", "JSON_ESCAPE_STRING", "JSON_STREAM_TO_GAP", "JSON_STRING_TO_GAP", 
"JUPYTER_Complete", "JUPYTER_DotSplash", "JUPYTER_FindHelp", "JUPYTER_FormatKnown", 
"JUPYTER_Inspect", "JUPYTER_KernelLoop", "JUPYTER_KernelStart_GAP", 
"JUPYTER_KernelStart_HPC", "JUPYTER_RunCommand", "JUPYTER_SubgroupLatticeSplash", 
"JUPYTER_TikZSplash", "JUPYTER_ViewString", "JUPYTER_print", "JsonStreamToGap", 
"JsonStringToGap", "JupyterDefaultKernelConfig", "JupyterMsg", "JupyterMsgDecode", 
"JupyterMsgEncode", "JupyterMsgRecv", "JupyterMsgSend", "LastReadValue", 
"NewJupyterKernel", "NewUUID", "RandomUUID", "Run", "SHA256String", "StringUUID", 
"SynchronizationFamily", "TYPE_ZMQ_SOCKET", "UUIDFamily", "UUIDType", "ZmqAttach", 
"ZmqAttachedSocket", "ZmqBind", "ZmqClose", "ZmqConnect", "ZmqDealerSocket", 
"ZmqGetIdentity", "ZmqGetReceiveBufferSize", "ZmqGetReceiveCapacity", 
"ZmqGetSendBufferSize", "ZmqGetSendCapacity", "ZmqHasMore", "ZmqIsBound", 
"ZmqIsConnected", "ZmqIsOpen", "ZmqPoll", "ZmqPublisherSocket", "ZmqPullSocket", 
"ZmqPushSocket", "ZmqReceive", "ZmqReceiveList", "ZmqReceiveListAsString", 
"ZmqReplySocket", "ZmqRequestSocket", "ZmqRouterSocket", "ZmqSend", "ZmqSetIdentity", 
"ZmqSetReceiveBufferSize", "ZmqSetReceiveCapacity", "ZmqSetSendBufferSize", 
"ZmqSetSendCapacity", "ZmqSocket", "ZmqSocketType", "ZmqSocketURI", "ZmqSubscribe", 
"ZmqSubscriberSocket", "ZmqUnsubscribe", "_GapToJsonStreamInternal", "_JSON_Globals", 
"_JSON_addRef", "_JSON_clearRefs", "_JUPYTER_FindManSection", "a", "b" ]

It would be nice to have these cutted down ... Thanks, Pedro

fingolfin commented 6 years ago

But that's the usual behavior of GAP -- I am not sure what JupyterKernel could or should do about this...

See also https://github.com/gap-system/gap/issues/811

olexandr-konovalov commented 6 years ago

@pedritomelenas what does

Filtered(NamesGVars(), x -> not IsBoundGlobal(x));

return?

pedritomelenas commented 6 years ago
[ "CambridgeMaps", "CurrentThread", "DEFAULT_INPUT_STREAM", "DEFAULT_OUTPUT_STREAM",
"ENABLE_AUTO_RETYPING", "GET_RANDOM_SEED_COUNTER", "HELPBOOKINFOSIXTMP", 
"HPCGAP", "INFODATA_DEFAULT_HANDLER", "IO_FuncToUnpickle", "IO_PkgThingsToRead", 
"IsomorphismTypeInfoFiniteSimpleGroup_fun", "MANEXreadobs", "MULTI_SESSION", 
"NEW_REGION", "OPERATIONS_REGION", "OnCharReadHookActive", "READ_SMALL_LIB", 
"RecogsFunnyNameFormatterFunction", "RecogsFunnyWWWURLFunction", "THREAD_UI", 
"ThreadLocalRecord", "_EVALSTRINGTMP", "_IO_Defines_ChangeDirectoryCurrent", "_PATH_SO", 
"_RecogsFunnyNameFormatterFunction", "_RecogsFunnyWWWURLFunction", "_STANDREWS", 
"_ViewStringForSemigroups", "_ViewStringForSemigroupsGroups", "__GAPZEROMQ_C", "last3", "p" ]
olexandr-konovalov commented 3 years ago

This is normal behaviour, not an issue with the JupyterKernel - although the output of Filtered(NamesGVars(), x -> not IsBoundGlobal(x)); may point to some "interesting" things elsewhere that might need to be removed or made write protected.