In SRFI 40 we can see it is deprecated and superseded by SRFI 41. I'm using SISC where SRFI 40 is present but SRFI 41 isn't. I would like to know the main difference between them and can I use the SRFI 40 normally without fear?
SRFI-40 leaks in some circumstances. See the times3 function in the "Pitfalls" section of SRFI-41. See also the post-finalization discussion of SRFI-40.
It is possible to patch SRFI-40 to fix the problems, and some users have done so. I'm not sure if SISC has been patched. Also, David van Horn and Andre van Tonder have both made changes to the original reference implementation of SRFI-40, so I'm not sure but that may also work properly now. I personally avoid the problem and use SRFI-41.
Is there any reason SRFI-41 can't be used in SISC?
I am the author of SRFI-40 and SRFI-41.
Related
Is there any good way to find where is a function being called in our codebase ?
There is a gem called Starscope (disclaimer: I am the author) which can list function calls in ruby code, among other things. It isn't perfect, since it can't handle crazy meta-programming, but it will find all the normal calls to a given function.
gem: https://rubygems.org/gems/starscope
github: https://github.com/eapache/starscope
user guide: https://github.com/eapache/starscope/blob/master/doc/USER_GUIDE.md
edit: Luc's answer is entirely accurate as far as it goes; I wrote Starscope specifically to be "Cscope for Ruby".
With ctags, no. It references functions declarations and definitions, not their uses.
Then it depends on the language.
cscope can help with C, but not with C++. With C++, you should have a look at clang based solutions : there is clang_indexer (and its many forks) (see vim-clang to integrate it in vim), but I did found a few quirks ; it seems YouCompleteMe does a few things related to code indexation (as it provides GotoImplementation/Declaration commands).
For other languages, you may have dedicated plugins. But for sure, there is always grep (and many plugins that integrates it)
(Mathematica version: 8.0.4)
lst = Names["Internal`*"];
Length[lst]
Pick[lst, StringMatchQ[lst, "*Bag*"]]
gives
293
{"Internal`Bag", "Internal`BagLength", "Internal`BagPart", "Internal`StuffBag"}
The Mathematica guidebook for programming By Michael Trott, page 494 says on the Internal context
"But similar to Experimental` context, no guarantee exists that the behavior and syntax of the functions will still be available in later versions of Mathematica"
Also, here is a mention of Bag functions:
Implementing a Quadtree in Mathematica
But since I've seen number of Mathematica experts here suggest Internal`Bag functions and use them themselves, I am assuming it would be sort of safe to use them in actual code? and if so, I have the following question:
Where can I find a more official description of these functions (the API, etc..) like one finds in documenation center? There is nothing now about them now
??Internal`Bag
Internal`Bag
Attributes[Internal`Bag]={Protected}
If I am to start using them, I find it hard to learn about new functions by just looking at some examples and trial and error to see what they do. I wonder if someone here might have a more complete and self contained document on the use of these, describe the API and such more than what is out there already or a link to such place.
The Internal context is exactly what its name says: Meant for internal use by Wolfram developers.
This means, among other things, the following things hold about anything you might find in there:
You most likely won't be able to find any official documentation on it, as it's not meant to be used by the public.
It's not necessarily as robust about invalid arguments. (Crashing the kernel can easily happen on some of them.)
The API may change without notice.
The function may disappear completely without notice.
Now, in practice some of them may be reasonably stable, but I would strongly advise you to steer away from them. Using undocumented APIs can easily leave you in for a lot of pain and a nasty surprise in the future.
Is there a reference website to look up syntax for Scheme library function like http://www.cplusplus.com/reference/?
I'm looking for syntax of fold, but google gave me nothing :(
Thanks,
fold is from SRFI 1. Many functions have good documentation if you know where it "comes from".
Also, since you're using Racket (as mentioned in your previous questions), you should check out the Racket documentation. It has a very nice search facility. (Also, you might like to know about Racket's foldl, which is identical to SRFI 1's fold.)
Cocoa is well-documented and there is a lot of information on writing Cocoa code in good form. I'm working on some code that works closely with hardware, requiring me to use CoreFoundation and Carbon APIs often. Is there any sort of 'style' guide for understanding libraries such as Carbon and CoreFoundation from Apple? Apple's example code is littered with things like:
kSomeValue
CFMightDoSomethingUseful
I can deduce that CF means CoreFoundation and k might be for constants or enumerated types, but I would like to verify this and learn more about the other syntactic styles.
Core Foundation Design Concepts at the Mac Dev Center actually cleared up my question.
I can deduce that CF means CoreFoundation …
Specifically, it's the prefix for functions, types, and constants in the Core Foundation framework.
… and k might be for constants or enumerated types…
Yup. This one dates back all the way to the Toolbox days, before Core Foundation even existed. I believe it was a Pascal custom.
Aside from these rules, I'm not aware of any general CF/Carbon style guides.
You might try going even more general and picking up some books on C style. Compare and contrast between them; there is often no objectively-right answer.
One that I like is “Enough Rope to Shoot Yourself in the Foot”, by Allen Holub. It's witty and makes some good cases. Holub has a summary version on his website (just the rules themselves, without the detailed explanations); as far as I can tell, the full book is out of print.
What are coding conventions and guidelines you suggest for writing Bison (.y) and flex (.lex) files?
Please address the length of the code sections and their style.
Thanks,
Asaf
P.S.,
There's an old thread about it here, but I'm looking for a more detailed answer (and to have it on SO!).
For questions like this in general I would typically see what other people have done. Good resources for this are Google Code Search and Koders. Both support searching by a specific programming language; however it appears that only Google has lex as a listed language.
Other than that, I generally try to keep to either 79 or 96 columns in source code, to make sure I can view at least 2 windows-worth of code side by side.