Note that there are some explanatory texts on larger screens.

plurals
  1. USAntonio Bonifati 'Farmboy'
    primarykey
    data
    text
    plurals
    1. COThanks to all. It seems this fundamental feature is lacking in the standard and must be added in some way. Rather than introducing new syntax, mimicking Perl or PHP, what do you think about writing a macro that wraps make-hash-table and adds the option :initial-contents, the same option supported in the standard by, e.g., make-array? I think this won't probably be very efficient, since content would be specified by an alist that has to be traversed, but it is at least more consistent with Lisp syntax.
      singulars
    2. COThanks Lisp hacker! It makes sense, I forgot the output from print is readable! All makes sense in Lisp and "there is always the right way to do it" :) Anyway, the standard has some shortcomings and we cannot change it :( For instance about printing line numbers I don't have a clue.
      singulars
    3. COYes, thanks, I know, a good reason for that is that macros are harder to write and debug. But if I write a function in this case, I cannot call it with #. At least in ECL it tells me it is undefined. I think this is the effect of #. that is any user defined function is not available at read-time. I wonder if a macro wrapper can be written that allows one to fully configure make-hash-table while adding an :initial-contents keyword parameter. That would "add this feature to the standard" :)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload