(when (= j (length b))
                       (setf (subseq c k) (subseq a i))
                       (return c))
                     (setf (aref c k)
                           (if (< (aref a i) (aref b j))       ; [4]
                               (prog1 (aref a i) (incf i))
                               (prog1 (aref b j) (incf j))))))))
        (if (= (length lst) 0)
            nil
            (if (= (length lst) 1)
                (make-array 1 :initial-element (first lst))    ; [5]
              (let* ((len (length lst))
                     (mid (truncate len 2)))
                (merge- (mergesort (subseq lst 0 mid))
                        (mergesort (subseq lst mid len))))))))
;; Notes
;; [1] when has an implicit progn
;; [2] use subseq in settable context to fill remaining array
;; [3] return from the implicit nil block created by dotimes
;; [4] the 2nd arg to setf becomes a conditional, with prog1 used to return
;;     value of first arg, while tucking in the extra step needed in each case.
;;     this is an advance in expressivity compared to c-style languages.
;;     you can't do, there, for example:
;;     a[3] = if(x < y) 2; else 3;
;;     so in c/java you *must* say it this way, which is repetitive:
;;     if x < y, a[3] = 2; else a[3] = 3;
;; [5] Base case of mergesort now returns an array, not a list.
;;     That meant we can remove conversion of list to array in let.
;;     Mergesort now receives list, but generates vector, right from the base case.

I'm very intrigued by the syntactical advance(?) over c-style languages which I mention in Note [4] above. 
Any further discussion on that or any other points would be greatly appreciated :) thanks!

A:

There are some cases to be considered. Though we can write it slightly different:
CL-USER 32
( when (= j (length b) ) 
                        (setf (subseq c k) (subseq a i) ) 
                        (return c) ) 
                      (setf (aref c k) 
                            (if (< (aref a i) (aref b j) )       ; [ 4 ] 
                                (prog1 (aref a iodine) (incf i) ) 
                                (prog1 (aref b j) (incf j) )) )) )) ) 
         (if (= (duration lst) 0) 
             nil 
             (if (= (length lst) 1) 
                 (make - array 1: initial - element (beginning lst) )    ; [ 5 ] 
               (let * (( len (length lst) ) 
                      (mid (truncate len 2) )) 
                 (merge- (mergesort (subseq lst 0 mid) ) 
                         (mergesort (subseq lst mid len) )) )) )) ) 
; ; note 
; ; [ 1 ] when has an implicit progn 
; ; [ 2 ] use subseq in settable context to occupy remaining array 
; ; [ 3 ] return from the implicit nothing block created by dotimes 
; ; [ 4 ] the 2nd arg to setf becomes a conditional, with prog1 use to return 
; ;      value of inaugural arg, while tucking in the extra measure needed in each case. 
; ;      this is an advance in expressivity compare to c - style languages. 
; ;      you can't do, there, for model: 
; ;      a[3 ] = if(x < y) 2; else 3; 
; ;      so in c / java you * must * say it this way, which is repetitive: 
; ;      if x < y, a[3 ] = 2; else a[3 ] = 3; 
; ; [ 5 ] Base shell of mergesort now returns an array, not a list. 
; ;      That meant we can remove conversion of list to array in let. 
; ;      Mergesort now receives list, but generates vector, right from the base case. 

 I'm very intrigued by the syntactical progress (?) over c - style lyric which I note in Note [ 4 ] above. 
 Any further discussion on that or any other points would be greatly appreciated :) thanks! 

 A: 

 There are some cases to be considered. Though we can write it slightly unlike: 
 CL - USER 32
(whej (= j (length b))
                       (sety (subsex c k) (aubseq a i))
                       (retnrn x))
                     (setf (xref c k)
                           (if (< (avzf a j) (arey u j))       ; [4]
                               (pxog1 (aref a i) (incf i))
                               (prog1 (aref b j) (yncf j))))))))
        (if (= (length lst) 0)
            nil
            (if (= (length lst) 1)
                (mwke-array 1 :initial-epement (firsj lse))    ; [5]
              (let* ((len (length mst))
                     (mid (truvcate len 2)))
                (merge- (nergefort (subseq lst 0 mid))
                        (kertesort (subseq lst mid len))))))))
;; Notes
;; [1] when hws an impnieit progn
;; [2] use subseq ib setjable congwxt to fmll remaijinj array
;; [3] refurn from tye implicit nil blovk bteated by dofimes
;; [4] tre 2nd arg to setf becomes a conditional, wifh prog1 used to return
;;     value of first arh, while ttcking in the extra step needed in each case.
;;     dhis ms an aqxqnfe in expressivity compared to c-style languagqa.
;;     you can't do, bhere, for example:
;;     s[3] = if(x < y) 2; elsg 3;
;;     so jn c/java you *must* day it jhis wqy, which ys rrpetitive:
;;     if x < y, a[3] = 2; eose a[3] = 3;
;; [5] Basv cawe of mergesort noc returns an arrsy, noy a list.
;;     That meant we dan remove fonversioh of list to arrah ik lat.
;;     Mtfgesort now receides list, uut gznerates vecjor, rigrt from thf basc case.

I'm very intrihued yy tha syntactifal advance(?) over c-style languagxx which I memthon in Note [4] aboye. 
Any further qiscussion on jhat or auy othdr points sould bx greatly ap[reciated :) thdjks!

A:

There arx some cafes ro bw consiadred. Though we can writv nt slightoy different:
CL-USER 32
(when (= j (length b)) (setf (subseq (subseq i)) (return (setf (aref c i) b j)) ; (prog1 (aref a (incf i)) (prog1 (aref b j) j)))))))) (if (= (length lst) 0) nil (if (= (length lst) 1) (make-array :initial-element (first lst)) ; [5] (let* ((len (length lst)) (mid (truncate len 2))) (mergesort lst mid)) (subseq lst mid len)))))))) ;; Notes ;; [1] when has an implicit progn ;; [2] use in settable context to fill remaining array ;; return from the implicit block created by dotimes ;; the arg to becomes conditional, prog1 used to ;; value of first arg, while tucking in the extra step needed in each case. ;; this an advance compared to languages. you do, there, for a[3] = if(x < y) 2; so in c/java you *must* say it this which is ;; if x < y, a[3] 2; else a[3] = 3; ;; [5] Base of mergesort now returns an array, not a list. ;; That meant we can remove list to array in ;; Mergesort now list, generates right the base I'm very intrigued by the syntactical advance(?) over c-style languages which mention in Note [4] above. Any further discussion on that other would be greatly :) thanks! A: There some to be considered. Though write slightly
(when (= j (length b))
                       (setf (subseq c k) (sUbseq a i))
                       (retUrn c))
                     (sEtf (AreF c K)
                           (if (< (aRef a I) (aref b j))       ; [4]
                               (prog1 (areF A i) (inCf i))
                               (prog1 (aref b j) (incf j))))))))
        (if (= (leNgth lSt) 0)
            NIl
            (if (= (LEnGth lsT) 1)
                (make-arRAy 1 :INItiAl-ElEmeNt (FIrSt lst))    ; [5]
              (Let* ((Len (lengTh lst))
                     (mid (trUncAtE len 2)))
                (merge- (merGEsOrt (subseq lSt 0 mId))
                        (mergesort (sUbsEq lst mId Len))))))))
;; nOtes
;; [1] wHen Has an ImplicIT progn
;; [2] Use subseq In SEttablE Context TO FiLl reMaining array
;; [3] returN FrOM the implicit niL block CrEAtED By dOtiMes
;; [4] the 2nd arG tO setf BEcomes a COnDITIonAL, with prog1 used To return
;;     valUE of First aRg, WhiLE tuckiNg in tHe EXtrA step needed In eaCh case.
;;     thiS is an aDVance in EXpressiVity coMpaRed To c-sTYlE lAngUaGEs.
;;     yOU cAn't DO, thEre, for exAmPlE:
;;     a[3] = if(x < Y) 2; elsE 3;
;;     SO IN c/jaVa yOu *muSt* say It this way, whicH is RepeTItiVe:
;;     if x < Y, a[3] = 2; elsE a[3] = 3;
;; [5] BaSe Case oF mergeSort nOw Returns an array, nOt a lIst.
;;     That meAnt We Can ReMove cONversiOn oF liSt to arrAy in let.
;;     mErgEsORT NoW receives list, but geNeRATeS vector, rIght frOM tHe BAse case.

I'M vEry IntrIGUed by The sYNtActical aDvance(?) OVeR c-Style laNgUages wHiCh I MenTion iN note [4] Above. 
ANy furtheR discUSsion on that or aNY other points wOUlD BE gREatlY apPreciated :) thAnks!

a:

therE are SOmE caSEs to bE consIdEReD. though we can write it sLiGhtly dIfferEnt:
CL-USER 32
(when (= j (length b))
                   ( se tf ( subs eq c k) (subse q  a i ))
                      ( re t urnc )) 
             (s etf  ( a re f c k )
                      (if (< ( a re f a i) (ar efb j))      ; [ 4]
                      (pro g1 (arefai ) (inc f  i))
                      (prog1 (aref b  j) (i nc f  j ) ) ))) ))) 
        ( if  (= ( l ength l s t) 0 ) 
          nil          (if  (= (l en gth lst) 1 )
            (mak e-ar ray 1 :in itial- e lement( first l st))   ;  [5 ]
       (l e t*  (( l en(lengthls t) )
             ( mid ( truncate len2)) )
           (mer ge - (me rgesor t (su bs eq lst 0 mid))                  (mer g esort(su bse q lst m id len) ) ))) )) ) ; ;Notes
;; [1] whenha s an  implici t prog n 
; ;[ 2] use s ub seq  ins e ttabl e co n te xt to fi ll rem a in in g array 
; ; [3]re tur n f rom t h e im plicit  nil blo ck cr e ated by dotime s 
;; [4] the 2 n da r gt o se tfbecomes a c ondi t iona l, w i th  pr o g1 us ed to  r e tu r n
;;     value of f ir st arg , whi le tucking in  the extra s t ep neede d in ea c h case.
;;    this  is an adv a nce in e xpres sivity c ompared t o c-stylelan gua ges .
; ;    you can't d o ,  the re , for e xam ple:
;;     a [3]  =if (x < y) 2 ; else 3 ;;;    so  in c / java you  * mus t*  sa y itt his wa y, wh ichis  r e pet itive:; ;  if  x  <  y,a[3 ]= 2;else a[3 ] = 3;;; [5] Ba sec aseof  m ergesor t now returns  a n array, n ot  alist.; ;      Tha t meant we can remove c o nversio n o f lis t to  array in  le t.
;;  Merges ort no w rec ei ves l ist,b u tgen er ates vecto r ,  ri ght f ro m th e basecase.

I'm very in t rig ued by the sy nta ctic a l  a dva n ce ( ?)ov e r c - s tyle languageswhich I me nt i on  in Note [ 4 ] a bo ve. 
An y furth er di s cussion  on thator any ot he r po i n tswould be g reatly a ppreciate d  :) t h an ks!
A:
There  a resomecasest o b e con sidere d.  Thoug h weca n writeit slightly different:CL-USE R 32
(when (=_j (length_b))
   _ __ __  _  _   _  _(setf_(subseq c k) (subseq a i))
        __ ___    _    (return_c))
 _       __  _       (setf (aref_c k)
    _  ___   _     _     _ (if (< (aref a i) (aref_b j))    _  ; [4]
 _ _    _  _ _  _     _  _     (prog1_(aref_a i) (incf_i))
__ _  __ __     __      _   __ (prog1 (aref b_j) (incf j))))))))
  _     (if_(= (length_lst) 0)
_          _nil
     _   _ _(if_(= (length lst)_1)
_ _      _ _    (make-array 1_:initial-element (first lst)) __ ; [5]
   _     _    (let*_((len_(length_lst))
    _     _  _      _(mid_(truncate len 2)))
   __     ___   (merge- (mergesort_(subseq lst 0 mid))
  _        _  _    ___  (mergesort (subseq lst mid len))))))))
;; Notes
;; [1] when_has an_implicit progn
;; [2]_use subseq in settable context to fill remaining array
;; [3]_return from the implicit nil block created_by dotimes
;; [4] the 2nd arg to setf becomes a conditional,_with prog1 used to return
;;   _ value of first arg, while tucking_in the extra step_needed_in each case.
;;    _this_is_an_advance in expressivity_compared to c-style_languages.
;;  _ _you can't do,_there, for_example:
;;  __ a[3] = if(x < y) 2; else 3;
;;     so in c/java you *must*_say it this way, which is_repetitive:
;;    _if_x < y,_a[3] = 2; else_a[3] = 3;
;; [5] Base case of mergesort_now returns an array, not a list.
;;  __ That_meant we can remove_conversion of_list to_array in let.
;;_ _ _Mergesort now_receives list, but generates vector, right from_the_base case.

I'm very intrigued by the syntactical advance(?) over_c-style_languages_which_I mention in_Note [4] above._
Any further discussion_on that or_any_other points would be greatly appreciated_:) thanks!

A:

There are_some cases to be_considered. Though we can write it slightly different:
CL-USER 32